Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Urgent Pls help - Repainting GUI

 
Garry Kalra
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm currently building a GUI and in the main window, i add panels in the center(BorderLayout). I have two panels and depending on a button, i display one of them.
When the switch has to happen, i remove the first and display the other. But during this i am facing refresh problems.
Can anybody guide what to do as i am confused about validate, invalidate, setVisible. What to use.
Any help will be greatly appreciated.
Garry
 
vladimir levin
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at CardLayout. It sounds like your life might
be made easier using that rather than manually handling
transitions beween these panels.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!