| Author |
On click on menuitem jPanel is not displayed but it will be displayed after minimizing the app.
|
ishan dave
Ranch Hand
Joined: Apr 16, 2007
Posts: 39
|
|
Hi All,
Currently I am developing an application where I have a menubar with menuitems.
For example
Customer
Create New
Edit
View
Vehicle
Add New
Update
now for this application I have a jFrame(This is the main container of my application) and have 5 jPanel corresponding to every menuitem i.e. CreateNewCustomerPanel, EditCustomerPanel, ViewCustomerPanel etc
and what try to achieve is on click of the menuitem want to show the corresponding panel. so for that following is my code
Now when I run my application and click on "Create New" menuitem nothing is being shown but if I minimize the application and maximize it again it'll show me the new jPanel i.e. createCustomer. It should load at the time of menuitem click.
Can any one please help to solve this that how can I manage to open createNewCustomerPanel on the first time click on the button only.
Thank you very much in advance.
Thank you,
Ishan
|
 |
Maneesh Godbole
Saloon Keeper
Joined: Jul 26, 2007
Posts: 8436
|
|
1) After you add/remove the panels, call revalidate and repaint on the container
2) User CardLayout
|
[Donate a pint, save a life!] [How to ask questions] [Onff-turn it on!]
|
 |
ishan dave
Ranch Hand
Joined: Apr 16, 2007
Posts: 39
|
|
Hi Maneesh,
Thank you very much for your reply.
With best regards,
Ishan
|
 |
 |
|
|
subject: On click on menuitem jPanel is not displayed but it will be displayed after minimizing the app.
|
|
|