1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139
| class MyWindow extends JFrame{ public static JPanel contentPane; public static JTextField textField; public static JTextField textField_1; public static JTextField textField_2; public static JTextField textField_3; public static JTextField textField_4; public static JTextField textField_5; public static JTextField textField_6; public static JTextField textField_7; public static JTextField textField_8; public static JTextField textField_9;
public void display()throws Exception { MyWindow frame = new MyWindow(); frame.setVisible(true); }
public MyWindow() { setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(100, 100, 450, 300); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); textField = new JTextField(); textField.setBackground(Color.PINK); textField.setText(" 正在营业 "); textField.setColumns(10); textField_1 = new JTextField(); textField_1.setText("第0位客户"); textField_1.setColumns(10); textField_2 = new JTextField(); textField_2.setText("交易:0"); textField_2.setColumns(10); textField_3 = new JTextField(); textField_3.setText("余额:0"); textField_3.setColumns(10); textField_4 = new JTextField(); textField_4.setText("银行余额"); textField_4.setColumns(10); textField_5 = new JTextField(); textField_5.setBackground(Color.PINK); textField_5.setText("正在交易"); textField_5.setColumns(10); textField_6 = new JTextField(); textField_6.setText("0"); textField_6.setColumns(10); textField_7 = new JTextField(); textField_7.setText("等待人数"); textField_7.setColumns(10); textField_8 = new JTextField(); textField_8.setText("0"); textField_8.setColumns(10); textField_9 = new JTextField(); textField_9.setText("时长:0"); textField_9.setColumns(10); GroupLayout gl_contentPane = new GroupLayout(contentPane); gl_contentPane.setHorizontalGroup( gl_contentPane.createParallelGroup(Alignment.LEADING) .addGroup(gl_contentPane.createSequentialGroup() .addGap(84) .addComponent(textField, GroupLayout.PREFERRED_SIZE, 222, GroupLayout.PREFERRED_SIZE) .addContainerGap(112, Short.MAX_VALUE)) .addGroup(gl_contentPane.createSequentialGroup() .addGroup(gl_contentPane.createParallelGroup(Alignment.TRAILING, false) .addGroup(gl_contentPane.createSequentialGroup() .addGap(157) .addComponent(textField_3)) .addGroup(Alignment.LEADING, gl_contentPane.createSequentialGroup() .addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING) .addComponent(textField_7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addComponent(textField_8, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addGap(61) .addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING, false) .addComponent(textField_2) .addComponent(textField_1, 0, 0, Short.MAX_VALUE) .addComponent(textField_5, GroupLayout.DEFAULT_SIZE, 87, Short.MAX_VALUE) .addComponent(textField_9)))) .addPreferredGap(ComponentPlacement.RELATED, 69, Short.MAX_VALUE) .addGroup(gl_contentPane.createParallelGroup(Alignment.TRAILING, false) .addComponent(textField_6) .addComponent(textField_4))) ); gl_contentPane.setVerticalGroup( gl_contentPane.createParallelGroup(Alignment.LEADING) .addGroup(gl_contentPane.createSequentialGroup() .addComponent(textField, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addGap(15) .addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING) .addGroup(gl_contentPane.createSequentialGroup() .addPreferredGap(ComponentPlacement.RELATED) .addGroup(gl_contentPane.createParallelGroup(Alignment.LEADING) .addGroup(gl_contentPane.createSequentialGroup() .addGap(18) .addComponent(textField_5, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.UNRELATED) .addComponent(textField_1, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(textField_9, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addGroup(gl_contentPane.createSequentialGroup() .addGap(38) .addComponent(textField_4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(textField_6, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(textField_2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)) .addGroup(gl_contentPane.createSequentialGroup() .addGap(35) .addComponent(textField_7, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addGap(18) .addComponent(textField_8, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE))) .addPreferredGap(ComponentPlacement.RELATED) .addComponent(textField_3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE) .addContainerGap(GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); contentPane.setLayout(gl_contentPane); } }
|