MyEclipse Forums
This thread has been locked & this forum has been archived.
Please post new topics to General Development
View previous topic Printable version Log in to check your private messages View next topic
Author Message
Post subject: I can not call jpanel class from Jframe  PostPosted: Mar 27, 2011 - 06:56 PM

Joined: Mar 14, 2011
Posts: 36

I must have a lot of panels in my application.All main panels must be shown in same position.
When I click one button, reletad panel will be displayed with its components.
These panels also consist of panels,Jlabels,JButtons.......

To achieve this I have content panel in main frame.All other main panels will be added content panel according to clicked button.
I generated Java Panel by clicking New->Matisse->Panel(ResultBuilderPanel).Then I added my matisse components to panel.
Now My aim is to call this panel from JFrame when button is clicked.
I do not want to use Cardlayout.Because I do not prefer that there would be
so much code of lines in MAIN GUI

To do this I instantiate a global variable of ResultBuilderPanel in MainGu─▒.
Then I placed this piece of code in Mouseclicked event

private void RBButtonMouseClicked(java.awt.event.MouseEvent evt) {

resultBuilderPanel = new ResultBuilderPanel();
directoryLabel.setText(directoryLabel.getText() + "Result Browser");

But When I clicked related button panel is not shown.

Can anyone help me?
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group