no message
This commit is contained in:
parent
6c7889169e
commit
98510be4a5
|
|
@ -6,6 +6,7 @@ package gui.UI_LenheartUI;
|
|||
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
import java.io.File;
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
|
|
@ -13,6 +14,7 @@ import java.sql.SQLException;
|
|||
import java.util.List;
|
||||
import javax.swing.*;
|
||||
import javax.swing.border.*;
|
||||
import javax.swing.event.MouseInputAdapter;
|
||||
import javax.swing.table.*;
|
||||
import com.intellij.uiDesigner.core.*;
|
||||
import com.jgoodies.forms.factories.*;
|
||||
|
|
@ -198,6 +200,42 @@ 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) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -533,11 +571,13 @@ public class ExplosiveControl extends JPanel {
|
|||
|
||||
//---- button5 ----
|
||||
button5.setText("\u4e00\u952e\u5bfc\u5165");
|
||||
button5.addActionListener(e -> 独立爆率一键导入(e));
|
||||
add(button5);
|
||||
button5.setBounds(455, 625, 95, 34);
|
||||
|
||||
//---- button6 ----
|
||||
button6.setText("\u4e00\u952e\u5bfc\u51fa");
|
||||
button6.addActionListener(e -> 独立爆率一键导出(e));
|
||||
add(button6);
|
||||
button6.setBounds(560, 625, 95, 34);
|
||||
|
||||
|
|
@ -638,6 +678,52 @@ public class ExplosiveControl extends JPanel {
|
|||
SetRightL(this.table1);
|
||||
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
|
||||
|
|
|
|||
|
|
@ -326,6 +326,7 @@ new FormModel {
|
|||
add( new FormComponent( "javax.swing.JButton" ) {
|
||||
name: "button5"
|
||||
"text": "一键导入"
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "独立爆率一键导入", true ) )
|
||||
}, new FormLayoutConstraints( class com.jformdesigner.runtime.NullConstraints ) {
|
||||
"width": 95
|
||||
"height": 34
|
||||
|
|
@ -335,6 +336,7 @@ new FormModel {
|
|||
add( new FormComponent( "javax.swing.JButton" ) {
|
||||
name: "button6"
|
||||
"text": "一键导出"
|
||||
addEvent( new FormEvent( "java.awt.event.ActionListener", "actionPerformed", "独立爆率一键导出", true ) )
|
||||
}, new FormLayoutConstraints( class com.jformdesigner.runtime.NullConstraints ) {
|
||||
"width": 95
|
||||
"height": 34
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ public class FightControl extends JPanel {
|
|||
|
||||
Integer Count = (int) tableModel.getValueAt(i, 0);
|
||||
String NameFront = tableModel.getValueAt(i, 1).toString();
|
||||
String NameBack = tableModel.getValueAt(i, 1).toString();
|
||||
String NameBack = tableModel.getValueAt(i, 2).toString();
|
||||
|
||||
ZLConfig buffer = new ZLConfig();
|
||||
buffer.setNum(Count);
|
||||
|
|
|
|||
|
|
@ -244,7 +244,7 @@ public class Drop {
|
|||
* @param chance 爆率
|
||||
*/
|
||||
public static void insertGWId(int dropperid, int itemid, int chance) {
|
||||
MapleMonster dropperid1 = MapleLifeFactory.getMonster(itemid);
|
||||
MapleMonster dropperid1 = MapleLifeFactory.getMonster(dropperid);
|
||||
try {
|
||||
final Connection con = (Connection) DBConPool.getInstance().getDataSource().getConnection();
|
||||
PreparedStatement ps = null;
|
||||
|
|
|
|||
Loading…
Reference in New Issue