no message

This commit is contained in:
Lenheart 2025-03-15 22:12:37 +08:00
parent a94f423dda
commit c298932150
2 changed files with 65 additions and 14 deletions

View File

@ -41,7 +41,7 @@ public class FightControl extends JPanel {
}
private void 保存配置(ActionEvent e) {
// Start. = this.toggleButton3.isSelected() ? 1 : 0;
Start.zlkg = this.toggleButton3.isSelected() ? 1 : 0;
List<ZLConfig> Buf = new ArrayList<>();
DefaultTableModel tableModel = (DefaultTableModel) table1.getModel();
@ -75,6 +75,8 @@ public class FightControl extends JPanel {
button25 = new JButton();
toggleButton3 = new JToggleButton();
label3 = new JLabel();
scrollPane2 = new JScrollPane();
table2 = new JTable();
//======== this ========
setLayout(null);
@ -107,19 +109,19 @@ public class FightControl extends JPanel {
button21.setText("\u5220\u9664\u914d\u7f6e");
button21.addActionListener(e -> 删除配置(e));
add(button21);
button21.setBounds(375, 620, 100, 35);
button21.setBounds(375, 615, 100, 35);
//---- button19 ----
button19.setText("\u4fdd\u5b58\u914d\u7f6e");
button19.addActionListener(e -> 保存配置(e));
add(button19);
button19.setBounds(20, 620, 100, 35);
button19.setBounds(525, 615, 100, 35);
//---- button25 ----
button25.setText("\u65b0\u589e\u914d\u7f6e");
button25.addActionListener(e -> 新增配置(e));
add(button25);
button25.setBounds(270, 620, 100, 35);
button25.setBounds(270, 615, 100, 35);
//---- toggleButton3 ----
toggleButton3.setIcon(new ImageIcon(getClass().getResource("/image/OFF3.png")));
@ -128,12 +130,36 @@ public class FightControl extends JPanel {
toggleButton3.setContentAreaFilled(false);
toggleButton3.addActionListener(e -> 战力开关(e));
add(toggleButton3);
toggleButton3.setBounds(485, 10, 100, 35);
toggleButton3.setBounds(20, 615, 100, 35);
//---- label3 ----
label3.setText("\u6218\u529b\u5f00\u5173");
add(label3);
label3.setBounds(590, 15, 185, 30);
label3.setBounds(125, 620, 185, 30);
//======== scrollPane2 ========
{
//---- table2 ----
table2.setModel(new DefaultTableModel(
new Object[][] {
},
new String[] {
"\u6570\u5b57\u5355\u4f4d"
}
) {
Class<?>[] columnTypes = new Class<?>[] {
String.class
};
@Override
public Class<?> getColumnClass(int columnIndex) {
return columnTypes[columnIndex];
}
});
scrollPane2.setViewportView(table2);
}
add(scrollPane2);
scrollPane2.setBounds(505, 10, 120, 595);
{
// compute preferred size
@ -151,6 +177,9 @@ public class FightControl extends JPanel {
}
// JFormDesigner - End of component initialization //GEN-END:initComponents @formatter:on
this.toggleButton3.setSelected(Start.zlkg == 1 ? true : false);
DefaultTableModel tableModel = (DefaultTableModel)this.table1.getModel();
// 创建一个自定义的单元格渲染器用于右对齐字符串
DefaultTableCellRenderer rightRenderer = new DefaultTableCellRenderer();
@ -180,5 +209,7 @@ public class FightControl extends JPanel {
private JButton button25;
private JToggleButton toggleButton3;
private JLabel label3;
private JScrollPane scrollPane2;
private JTable table2;
// JFormDesigner - End of variables declaration //GEN-END:variables @formatter:on
}

View File

@ -40,7 +40,7 @@ new FormModel {
"width": 100
"height": 35
"x": 375
"y": 620
"y": 615
} )
add( new FormComponent( "javax.swing.JButton" ) {
name: "button19"
@ -49,8 +49,8 @@ new FormModel {
}, new FormLayoutConstraints( class com.jformdesigner.runtime.NullConstraints ) {
"width": 100
"height": 35
"x": 20
"y": 620
"x": 525
"y": 615
} )
add( new FormComponent( "javax.swing.JButton" ) {
name: "button25"
@ -60,7 +60,7 @@ new FormModel {
"width": 100
"height": 35
"x": 270
"y": 620
"y": 615
} )
add( new FormComponent( "javax.swing.JToggleButton" ) {
name: "toggleButton3"
@ -72,8 +72,8 @@ new FormModel {
}, new FormLayoutConstraints( class com.jformdesigner.runtime.NullConstraints ) {
"width": 100
"height": 35
"x": 485
"y": 10
"x": 20
"y": 615
} )
add( new FormComponent( "javax.swing.JLabel" ) {
name: "label3"
@ -81,8 +81,28 @@ new FormModel {
}, new FormLayoutConstraints( class com.jformdesigner.runtime.NullConstraints ) {
"width": 185
"height": 30
"x": 590
"y": 15
"x": 125
"y": 620
} )
add( new FormContainer( "javax.swing.JScrollPane", new FormLayoutManager( class javax.swing.JScrollPane ) ) {
name: "scrollPane2"
add( new FormComponent( "javax.swing.JTable" ) {
name: "table2"
"model": new com.jformdesigner.model.SwingTableModel( new java.util.Vector, new java.util.Vector {
add( "数字单位" )
}, new java.util.Vector {
add( class java.lang.String )
}, new java.util.Vector {
add( null )
}, new java.util.Vector {
add( null )
} )
} )
}, new FormLayoutConstraints( class com.jformdesigner.runtime.NullConstraints ) {
"x": 505
"y": 10
"width": 120
"height": 595
} )
}, new FormLayoutConstraints( null ) {
"location": new java.awt.Point( 0, 0 )