• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

On click on menuitem jPanel is not displayed but it will be displayed after minimizing the app.

 
ishan dave
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 11096
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) After you add/remove the panels, call revalidate and repaint on the container
2) User CardLayout
 
ishan dave
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Maneesh,

Thank you very much for your reply.

With best regards,
Ishan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic