public Frame1() { try { jbInit(); } catch (Exception e) { e.printStackTrace(); } }
public static void main(String[] args) { Frame1 frame1 = new Frame1(); frame1.setSize(new Dimension(400, 350)); frame1.show();
}
private void jbInit() throws Exception { this.getContentPane().setLayout(borderLayout1); jPanel1.setBackground(Color.red); jPanel1.setLayout(flowLayout1); jPanel2.setBackground(Color.red); jPanel2.setLayout(flowLayout2); jPanel3.setBackground(Color.pink); jPanel3.setLayout(gridLayout1); jLabel1.setPreferredSize(new Dimension(100, 16)); jLabel1.setText("请输入查询条件"); jTextField1.setPreferredSize(new Dimension(140, 22)); jTextField1.setText(""); jButton1.setText("查询"); jButton1.addActionListener(new Frame1_jButton1_actionAdapter(this)); flowLayout1.setAlignment(FlowLayout.LEFT); flowLayout1.setHgap(5); flowLayout1.setVgap(10); jButton2.setText("增加"); jButton3.setText("删除"); jButton4.setText("修改"); flowLayout2.setHgap(30); flowLayout2.setVgap(5); this.setDefaultCloseOperation(EXIT_ON_CLOSE); this.getContentPane().add(jPanel1, BorderLayout.NORTH); jPanel1.add(jLabel1, null); jPanel1.add(jTextField1, null); jPanel1.add(jButton1, null); this.getContentPane().add(jPanel2, BorderLayout.SOUTH); jPanel2.add(jButton2, null); jPanel2.add(jButton3, null); jPanel2.add(jButton4, null); this.getContentPane().add(jPanel3, BorderLayout.CENTER); jPanel3.add(jScrollPane1, null); jScrollPane1.getViewport().add(jTable1, null); }
(编辑:aniston)
|