原因,我为什么在窗体下面用不了方法?
public class JtextArea
extends JFrame {
BorderLayout borderLayout1 = new BorderLayout();
JPanel jPanel1 = new JPanel();
JTextArea txanull = new JTextArea();
JTextArea jTextArea1 = new JTextArea();
//public JtextArea(,19,10);
public JtextArea() {
try {
jbInit();
}
catch (Exception exception) {
exception.printStackTrace();
}
}
private void jbInit() throws Exception {
getContentPane().setLayout(borderLayout1);
txanull.setToolTipText("");
jTextArea1.setText("jTextArea1");
jTextArea1.setBounds(new Rectangle(69, 248, 62, 19));
jPanel1.add(jTextArea1);
jPanel1.add(txanull);
this.getContentPane().add(jPanel1, java.awt.BorderLayout.CENTER);
// txanull.setColumns(10);
//txanull.t;
txanull.setText("huang");
txanull.setBounds(new Rectangle(223, 59, 126, 66));
jPanel1.setLayout(null);
}
}
jTextArea1在public class JtextArea
extends JFrame 不能用方法;
而在 private void jbInit() throws Exception 下面可以用方法?
-------------------------------------
因为from下面没有面板,而JtextArea必需在面板下面才能用,所以才会出现方法?
from是容器,panel是中间容器,我一直不明白,为什么要建在panel下面?
jbInit() 这是什么?
构造方法里面是不是实现长高,还有色彩方面?