Topic: 谁用过JBuilder9.0开发过系统

  Print this page

1.谁用过JBuilder9.0开发过系统 Copy to clipboard
Posted by: lizhan
Posted on: 2006-03-10 16:40

请各位高手帮帮忙!我用JBuilder9.0编写个系统,但在主窗口的采单打不开子窗口,不是怎样回事?
主窗口的菜单事件响应代码如下:
public void jMenuItem1_actionPerformed(ActionEvent e) {
CustomerInfMan inFrame= new CustomerInfMan("用户信息管理",true,true,true,true);
desktop.add(inFrame);//把内部窗口添加到容器中
inFrame.setVisible(true);
inFrame.pack();
子窗口的代码如下 :
public class CustomerInfMan extends JInternalFrame{
......................
}

CustomerInfMan类是子窗口类.

2.Re:谁用过JBuilder9.0开发过系统 [Re: lizhan] Copy to clipboard
Posted by: yzdbj
Posted on: 2006-03-12 12:27

这种情况我也碰到过,!
原因是:你的子窗体已经打开了,但你看不到而已!
解决原理:在主窗体初始化时,将Jpanel放在JFrame上,再将JDesktopPane放在JPanel上,再添加子窗体时,加到JDesktopPane上!
我是这样解决的:
主窗体程序初始化时:
public class Main extends JFrame{
JPanel jp;
JDesktopPane jdp;

public Main(){
jp=new Jpanel();
jdp=new JDesktopPane();

jp=(JPanel)getContentPane();// or this.setContentPane(jp);
jp.add(jdp);
...
}

...
}
这样的话就可以了!!
解决的话,回复一下!

3.Re:谁用过JBuilder9.0开发过系统 [Re: lizhan] Copy to clipboard
Posted by: lizhan
Posted on: 2006-03-13 16:36

解决了,谢谢你的帮助!


   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