Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

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

 
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Maneesh,

Thank you very much for your reply.

With best regards,
Ishan
 
I can't take it! You are too smart for me! Here is the tiny ad:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic