📄 create_matrix_frame.java~11~
字号:
package fuzzy_project;import java.awt.*;import java.awt.event.*;import javax.swing.*;import com.borland.jbcl.layout.*;public class Create_Matrix_Frame extends JFrame { JPanel contentPane; XYLayout xYLayout1 = new XYLayout(); JLabel jLabel_row = new JLabel(); JTextField jTextField_row = new JTextField(); JLabel jLabel_col = new JLabel(); JTextField jTextField_col = new JTextField(); JButton jButton1 = new JButton(); //Construct the frame public Create_Matrix_Frame() { enableEvents(AWTEvent.WINDOW_EVENT_MASK); try { jbInit(); } catch(Exception e) { e.printStackTrace(); } } //Component initialization private void jbInit() throws Exception { contentPane = (JPanel) this.getContentPane(); jLabel_row.setText("矩阵的行数"); contentPane.setLayout(xYLayout1); this.setResizable(false); this.setSize(new Dimension(200, 150)); this.setTitle("创建原始矩阵"); jLabel_col.setText("矩阵的列数"); jButton1.setText("确定"); jButton1.addActionListener(new Create_Matrix_Frame_jButton1_actionAdapter(this)); jTextField_row.setForeground(Color.black); jTextField_row.setText(""); jTextField_col.setText(""); contentPane.add(jTextField_row, new XYConstraints(20, 35, 50, -1)); contentPane.add(jTextField_col, new XYConstraints(110, 35, 50, -1)); contentPane.add(jLabel_col, new XYConstraints(110, 13, -1, -1)); contentPane.add(jLabel_row, new XYConstraints(20, 13, -1, -1)); contentPane.add(jButton1, new XYConstraints(62, 68, 58, -1)); } //Overridden so we can exit when window is closed protected void processWindowEvent(WindowEvent e) { super.processWindowEvent(e); if (e.getID() == WindowEvent.WINDOW_CLOSING) { System.exit(0); } } void jButton1_actionPerformed(ActionEvent e) { this.dispose(); Matrix_Date_Frame mdf=new Matrix_Date_Frame(); mdf.setVisible(true); }}class Create_Matrix_Frame_jButton1_actionAdapter implements java.awt.event.ActionListener { Create_Matrix_Frame adaptee; Create_Matrix_Frame_jButton1_actionAdapter(Create_Matrix_Frame adaptee) { this.adaptee = adaptee; } public void actionPerformed(ActionEvent e) { adaptee.jButton1_actionPerformed(e); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -