MyEclipse: I can not call jpanel class from Jframe deryaaltuntas - Mar 27, 2011 - 06:56 PM Post subject: I can not call jpanel class from Jframe
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