请教一个Java Swing的“嗨翻人”的界面调试的问题。
高手,小弟希望您能够告诉小弟,下面这段代码:packagec_port_packageBJTeacher;importjava.awt.Rectangle;importj...
高手,小弟希望您能够告诉小弟,下面这段代码:
package c_port_packageBJTeacher;
import java.awt.Rectangle;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JTextArea;
import javax.swing.JPanel;
public class ChatWithPoint extends JFrame{
/**
*
*/
private static final long serialVersionUID = 1L;
JPanel jP = null;
JButton jB = null;
JTextArea jL = null;
public static void main(String[] args){
new ChatWithPoint();
}
public ChatWithPoint(){
jP = new JPanel();
jP.setLayout(null);
this.setBounds(new Rectangle(600, 330, 201, 332));
jP = new JPanel();
jP.setBounds(new Rectangle(0,0,201,332));
jL = new JTextArea();
// jL.setBounds(new Rectangle(700,330,200,332));
JButton jB = new JButton("确认");
jB.setBounds(0,0,180,150);
jL.setBounds(0,190,200,150);
jP.setOpaque(false);
jL.setOpaque(false);
jB.setOpaque(false);
//
jP.add(jB);
jP.add(jL);
this.add(jP);
this.setVisible(true);
}
}
为什么无法得到其中的“jL对象”的界面出现?
也就是说,我希望得到“jL对象的UI定义的图形出现”,但是,为何我想要的结果,迟迟不肯出现?
希望得到高手的赐教!! 展开
package c_port_packageBJTeacher;
import java.awt.Rectangle;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JTextArea;
import javax.swing.JPanel;
public class ChatWithPoint extends JFrame{
/**
*
*/
private static final long serialVersionUID = 1L;
JPanel jP = null;
JButton jB = null;
JTextArea jL = null;
public static void main(String[] args){
new ChatWithPoint();
}
public ChatWithPoint(){
jP = new JPanel();
jP.setLayout(null);
this.setBounds(new Rectangle(600, 330, 201, 332));
jP = new JPanel();
jP.setBounds(new Rectangle(0,0,201,332));
jL = new JTextArea();
// jL.setBounds(new Rectangle(700,330,200,332));
JButton jB = new JButton("确认");
jB.setBounds(0,0,180,150);
jL.setBounds(0,190,200,150);
jP.setOpaque(false);
jL.setOpaque(false);
jB.setOpaque(false);
//
jP.add(jB);
jP.add(jL);
this.add(jP);
this.setVisible(true);
}
}
为什么无法得到其中的“jL对象”的界面出现?
也就是说,我希望得到“jL对象的UI定义的图形出现”,但是,为何我想要的结果,迟迟不肯出现?
希望得到高手的赐教!! 展开
1个回答
2016-07-07
展开全部
JFrame jf = new JFrame();
JPanel jp = new JPanel();
d(jp);
JComboBox jcb[] = new JComboBox[20];
for(int i=0; i<jcb.length; i++){
d(jcb[i] = new JComboBox());
}
JPanel jp = new JPanel();
d(jp);
JComboBox jcb[] = new JComboBox[20];
for(int i=0; i<jcb.length; i++){
d(jcb[i] = new JComboBox());
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询