开发者

Hava a java panel load another jpanel

I'm using netbeans to create a GUI application. I've made a main form with a panel that I want other jPanels I make to be placed in. It seems like this should be simple to do seeing as the create new context menu allows me to make plain java panels. I've made all the variables public on the new frame also.

EDIT:

I have a separate class extending the jPanel that is public, I'm trying to load it into a panel I have on the main GUI using the following code:

private void qmcatActionPerformed(java.awt.event.ActionEvent evt) { 
    qmcat jQmcat = new qmcat(); 
    jQmcat.setVisible(true); 
    jPanel.add(jQmcat开发者_高级运维); 
    } 


I was using the wrong method, it is .add(name, then component) , this is sad.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜