Compare commits
	
		
			No commits in common. "bd92c59240a9f4394e40493bbe32a183a61b8694" and "8accc6cca20fda86413af160fd044dcf202ce098" have entirely different histories.
		
	
	
		
			bd92c59240
			...
			8accc6cca2
		
	
		|  | @ -6,7 +6,6 @@ package gui.UI_LenheartUI; | ||||||
| 
 | 
 | ||||||
| import java.awt.*; | import java.awt.*; | ||||||
| import java.awt.event.*; | import java.awt.event.*; | ||||||
| import java.io.File; |  | ||||||
| import java.sql.Connection; | import java.sql.Connection; | ||||||
| import java.sql.PreparedStatement; | import java.sql.PreparedStatement; | ||||||
| import java.sql.ResultSet; | import java.sql.ResultSet; | ||||||
|  | @ -14,7 +13,6 @@ import java.sql.SQLException; | ||||||
| import java.util.List; | import java.util.List; | ||||||
| import javax.swing.*; | import javax.swing.*; | ||||||
| import javax.swing.border.*; | import javax.swing.border.*; | ||||||
| import javax.swing.event.MouseInputAdapter; |  | ||||||
| import javax.swing.table.*; | import javax.swing.table.*; | ||||||
| import com.intellij.uiDesigner.core.*; | import com.intellij.uiDesigner.core.*; | ||||||
| import com.jgoodies.forms.factories.*; | import com.jgoodies.forms.factories.*; | ||||||
|  | @ -200,42 +198,6 @@ public class ExplosiveControl extends JPanel { | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     private void 独立爆率一键导入(ActionEvent e) { |  | ||||||
|         // 创建 JFileChooser 实例 |  | ||||||
|         JFileChooser fileChooser = new JFileChooser(); |  | ||||||
| 
 |  | ||||||
|         // 显示文件选择对话框 |  | ||||||
|         int result = fileChooser.showOpenDialog(null); |  | ||||||
| 
 |  | ||||||
|         // 处理用户的选择 |  | ||||||
|         if (result == JFileChooser.APPROVE_OPTION) { |  | ||||||
|             // 用户选择了文件 |  | ||||||
|             File selectedFile = fileChooser.getSelectedFile(); |  | ||||||
|             System.out.println("选择的文件: " + selectedFile.getAbsolutePath()); |  | ||||||
|         } else if (result == JFileChooser.CANCEL_OPTION) { |  | ||||||
| 
 |  | ||||||
|         } |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     private void 独立爆率一键导出(ActionEvent e) { |  | ||||||
|         // 创建 JFileChooser 实例 |  | ||||||
|         JFileChooser folderChooser = new JFileChooser(); |  | ||||||
|         // 设置选择模式为只选择文件夹 |  | ||||||
|         folderChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); |  | ||||||
| 
 |  | ||||||
|         // 显示文件夹选择对话框 |  | ||||||
|         int result = folderChooser.showOpenDialog(null); |  | ||||||
| 
 |  | ||||||
|         // 处理用户的选择 |  | ||||||
|         if (result == JFileChooser.APPROVE_OPTION) { |  | ||||||
|             // 用户选择了文件夹 |  | ||||||
|             File selectedFolder = folderChooser.getSelectedFile(); |  | ||||||
|             System.out.println("选择的文件夹: " + selectedFolder.getAbsolutePath()); |  | ||||||
|         } else if (result == JFileChooser.CANCEL_OPTION) { |  | ||||||
| 
 |  | ||||||
|         } |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | @ -571,13 +533,11 @@ public class ExplosiveControl extends JPanel { | ||||||
| 
 | 
 | ||||||
|         //---- button5 ---- |         //---- button5 ---- | ||||||
|         button5.setText("\u4e00\u952e\u5bfc\u5165"); |         button5.setText("\u4e00\u952e\u5bfc\u5165"); | ||||||
|         button5.addActionListener(e -> 独立爆率一键导入(e)); |  | ||||||
|         add(button5); |         add(button5); | ||||||
|         button5.setBounds(455, 625, 95, 34); |         button5.setBounds(455, 625, 95, 34); | ||||||
| 
 | 
 | ||||||
|         //---- button6 ---- |         //---- button6 ---- | ||||||
|         button6.setText("\u4e00\u952e\u5bfc\u51fa"); |         button6.setText("\u4e00\u952e\u5bfc\u51fa"); | ||||||
|         button6.addActionListener(e -> 独立爆率一键导出(e)); |  | ||||||
|         add(button6); |         add(button6); | ||||||
|         button6.setBounds(560, 625, 95, 34); |         button6.setBounds(560, 625, 95, 34); | ||||||
| 
 | 
 | ||||||
|  | @ -678,52 +638,6 @@ public class ExplosiveControl extends JPanel { | ||||||
|         SetRightL(this.table1); |         SetRightL(this.table1); | ||||||
|         SetRightL(this.table2); |         SetRightL(this.table2); | ||||||
| 
 | 
 | ||||||
|         DefaultTableModel tableModel = (DefaultTableModel) table2.getModel(); |  | ||||||
|         // 创建 TableRowSorter 并关联到 JTable |  | ||||||
|         TableRowSorter<DefaultTableModel> sorter = new TableRowSorter<>(tableModel); |  | ||||||
|         table2.setRowSorter(sorter); |  | ||||||
| 
 |  | ||||||
|         DefaultTableModel tableModel1 = (DefaultTableModel) table1.getModel(); |  | ||||||
|         // 创建 TableRowSorter 并关联到 JTable |  | ||||||
|         TableRowSorter<DefaultTableModel> sorter1 = new TableRowSorter<>(tableModel1); |  | ||||||
|         table1.setRowSorter(sorter1); |  | ||||||
| 
 |  | ||||||
|         // 为 JTable 添加鼠标监听器 |  | ||||||
|         table2.addMouseListener(new MouseInputAdapter() { |  | ||||||
|             @Override |  | ||||||
|             public void mouseClicked(MouseEvent e) { |  | ||||||
|                 // 获取点击的行和列 |  | ||||||
|                 int row = table2.rowAtPoint(e.getPoint()); |  | ||||||
| 
 |  | ||||||
|                 if (row >= 0) { |  | ||||||
|                     // 获取点击单元格的值 |  | ||||||
|                     Object MonId = table2.getValueAt(row, 2); |  | ||||||
|                     Object ItemId = table2.getValueAt(row, 4); |  | ||||||
|                     Object Chance = table2.getValueAt(row, 5); |  | ||||||
| 
 |  | ||||||
|                     G_1.setText(MonId.toString()); |  | ||||||
|                     G_2.setText(ItemId.toString()); |  | ||||||
|                     G_3.setText(Chance.toString()); |  | ||||||
|                 } |  | ||||||
|             } |  | ||||||
|         }); |  | ||||||
| 
 |  | ||||||
|         table1.addMouseListener(new MouseInputAdapter() { |  | ||||||
|             @Override |  | ||||||
|             public void mouseClicked(MouseEvent e) { |  | ||||||
|                 // 获取点击的行和列 |  | ||||||
|                 int row = table1.rowAtPoint(e.getPoint()); |  | ||||||
| 
 |  | ||||||
|                 if (row >= 0) { |  | ||||||
|                     // 获取点击单元格的值 |  | ||||||
|                     Object ItemId = table1.getValueAt(row, 2); |  | ||||||
|                     Object Chance = table1.getValueAt(row, 3); |  | ||||||
| 
 |  | ||||||
|                     G_5.setText(ItemId.toString()); |  | ||||||
|                     G_6.setText(Chance.toString()); |  | ||||||
|                 } |  | ||||||
|             } |  | ||||||
|         }); |  | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables  @formatter:off |     // JFormDesigner - Variables declaration - DO NOT MODIFY  //GEN-BEGIN:variables  @formatter:off | ||||||
|  |  | ||||||
|  | @ -326,7 +326,6 @@ new FormModel { | ||||||
| 			add( new FormComponent( "javax.swing.JButton" ) { | 			add( new FormComponent( "javax.swing.JButton" ) { | ||||||
| 				name: "button5" | 				name: "button5" | ||||||
| 				"text": "一键导入" | 				"text": "一键导入" | ||||||
| 				addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "独立爆率一键导入", true ) ) |  | ||||||
| 			}, new FormLayoutConstraints( class com.jformdesigner.runtime.NullConstraints ) { | 			}, new FormLayoutConstraints( class com.jformdesigner.runtime.NullConstraints ) { | ||||||
| 				"width": 95 | 				"width": 95 | ||||||
| 				"height": 34 | 				"height": 34 | ||||||
|  | @ -336,7 +335,6 @@ new FormModel { | ||||||
| 			add( new FormComponent( "javax.swing.JButton" ) { | 			add( new FormComponent( "javax.swing.JButton" ) { | ||||||
| 				name: "button6" | 				name: "button6" | ||||||
| 				"text": "一键导出" | 				"text": "一键导出" | ||||||
| 				addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "独立爆率一键导出", true ) ) |  | ||||||
| 			}, new FormLayoutConstraints( class com.jformdesigner.runtime.NullConstraints ) { | 			}, new FormLayoutConstraints( class com.jformdesigner.runtime.NullConstraints ) { | ||||||
| 				"width": 95 | 				"width": 95 | ||||||
| 				"height": 34 | 				"height": 34 | ||||||
|  |  | ||||||
|  | @ -49,7 +49,7 @@ public class FightControl extends JPanel { | ||||||
| 
 | 
 | ||||||
|             Integer Count = (int) tableModel.getValueAt(i, 0); |             Integer Count = (int) tableModel.getValueAt(i, 0); | ||||||
|             String NameFront = tableModel.getValueAt(i, 1).toString(); |             String NameFront = tableModel.getValueAt(i, 1).toString(); | ||||||
|             String NameBack = tableModel.getValueAt(i, 2).toString(); |             String NameBack = tableModel.getValueAt(i, 1).toString(); | ||||||
| 
 | 
 | ||||||
|             ZLConfig buffer = new ZLConfig(); |             ZLConfig buffer = new ZLConfig(); | ||||||
|             buffer.setNum(Count); |             buffer.setNum(Count); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue