一个关于表的程序!
大家帮我看看,为什么这个界面里的表的表头出不来???package clients;
/**
* @author weiwei
*
*
* @version1.02
*/
import javax.swing.*;
import java.awt.*;
public class DozenAnzextends JPanel {
JPanel jPanel1 = new JPanel();
JPanel jPanel2 = new JPanel();
JPanel jPanel3 = new JPanel();
JList jList1 = new JList();
JTextArea jTextArea1 = new JTextArea();
JLabel jLabel1 = new JLabel();
JLabel jLabel2 = new JLabel();
JLabel jLabel3 = new JLabel();
JLabel jLabel4 = new JLabel();
JTextField jTextField1 = new JTextField();
JTextField jTextField2 = new JTextField();
JTextField jTextField3 = new JTextField();
JTextField jTextField4 = new JTextField();
JLabel jLabel5 = new JLabel();
JTextField jTextField5 = new JTextField();
public static void main(String[] args) {
}
public DozenAnz() {
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
private void jbInit() throws Exception {
this.setLayout(null);
jPanel1.setBorder(BorderFactory.createLineBorder(Color.black));
jPanel1.setBounds(new Rectangle(3, 1, 133, 294));
jPanel1.setLayout(null);
jPanel2.setBorder(BorderFactory.createLineBorder(Color.black));
jPanel2.setBounds(new Rectangle(140, 2, 233, 295));
jPanel2.setLayout(null);
jPanel3.setBorder(BorderFactory.createLineBorder(Color.black));
jPanel3.setBounds(new Rectangle(380, 0, 127, 296));
jPanel3.setLayout(null);
jList1.setBounds(new Rectangle(0, 3, 133, 291));
jTextArea1.setText("jTextArea1");
jTextArea1.setBounds(new Rectangle(1, 1, 123, 295));
jLabel1.setBorder(BorderFactory.createLineBorder(Color.black));
jLabel1.setText("jLabel1");
jLabel1.setBounds(new Rectangle(10, 8, 117, 18));
jLabel2.setBorder(BorderFactory.createLineBorder(Color.black));
jLabel2.setText("jLabel2");
jLabel2.setBounds(new Rectangle(9, 61, 115, 17));
jLabel3.setBorder(BorderFactory.createLineBorder(Color.black));
jLabel3.setText("jLabel3");
jLabel3.setBounds(new Rectangle(8, 111, 117, 19));
jLabel4.setBorder(BorderFactory.createLineBorder(Color.black));
jLabel4.setText("jLabel4");
jLabel4.setBounds(new Rectangle(8, 166, 121, 16));
jTextField1.setText("jTextField1");
jTextField1.setBounds(new Rectangle(9, 32, 160, 19));
jTextField2.setText("jTextField2");
jTextField2.setBounds(new Rectangle(7, 85, 163, 17));
jTextField3.setText("jTextField3");
jTextField3.setBounds(new Rectangle(7, 138, 166, 16));
jTextField4.setText("jTextField4");
jTextField4.setBounds(new Rectangle(8, 190, 167, 18));
jLabel5.setBorder(BorderFactory.createLineBorder(Color.black));
jLabel5.setText("jLabel5");
jLabel5.setBounds(new Rectangle(6, 220, 149, 15));
jTextField5.setText("jTextField5");
jTextField5.setBounds(new Rectangle(6, 245, 169, 18));
this.add(jPanel1, null);
jPanel1.add(jList1, null);
jPanel2.add(jLabel1, null);
jPanel2.add(jTextField1, null);
jPanel2.add(jLabel2, null);
jPanel2.add(jTextField2, null);
jPanel2.add(jLabel3, null);
jPanel2.add(jTextField3, null);
jPanel2.add(jLabel4, null);
jPanel2.add(jTextField4, null);
jPanel2.add(jLabel5, null);
jPanel2.add(jTextField5, null);
this.add(jPanel3, null);
jPanel3.add(jTextArea1, null);
this.add(jPanel2, null);
}
}
调整add部分的次序。this.add都放最后试试。JB有时候让人焦头烂额。
页:
[1]