• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Over writting JA\Panel content

 
Prashanth Bhanu
Ranch Hand
Posts: 110
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,

I've created a JFrame with Layout as Border Layout.At the center of Border layout i've placed a JPanel.Moment this JFrame is opened, at the center you can see a JPanel consisting of textboxes waiting for the user id and password to be inpued.
Now my problem is ,when user logs in ,a new screen should be painted at the Center area of the JFrames content pane over writing the existing content.
This can be achieved if you could place 'n' number of JPanels inadvance and depending the condition show the interested JPanel by hidding rest of the JPanels.
My criteria is ,I want to over write during the run time.There is no limit for the subsequent screens overwriting each other.
How this can be achieved.......thanks in adavnce
thanks in advance
 
Michael Dunn
Ranch Hand
Posts: 4632
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
set the center panel as a CardLayout
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic