Topic: GUI构造函数问题

  Print this page

1.GUI构造函数问题 Copy to clipboard
Posted by: oath911
Posted on: 2005-06-05 23:15

//anquan.java
... ... ...
public class anquan{
public static void main(String args[]) {
mianban mb = new mianban();
}

}
//mianban.java
import .... .... ....
public class mianban extends JFrame{
public mianban() {
super();
initialize();
}
private void initialize() {
this.setSize(300,200);
this.setContentPane(getJContentPane());
this.setTitle("JFrame");
}
................ ............}

调试没有其他语法错误,就是提示不能处理mianban mb = new mianban();难道这个不能调用构造?
而且我在eclipse里面调试无错,但是无法显示做的界面!求解

2.Re:GUI构造函数问题 [Re: oath911] Copy to clipboard
Posted by: oath911
Posted on: 2005-06-05 23:22

DDDDDDDDDDDDDDDDDD

3.Re:GUI构造函数问题 [Re: oath911] Copy to clipboard
Posted by: kavinwang
Posted on: 2005-06-06 08:38

把异常信息打印出来,好吗?

4.Re:GUI构造函数问题 [Re: oath911] Copy to clipboard
Posted by: dahen
Posted on: 2005-06-06 08:44

还要加一条语句:

this.setVisible(true);


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923