Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JPanel exactly over another JPanel  RSS feed

 
netharam ram
Ranch Hand
Posts: 202
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I have a JFrame,that contains a 3 Textfields & two buttons. On click of a button the JPanel1 should be displyed & when the other button is clicked another JPanel with 3 fields is made visible exactly over that of the previous JPanel. This is to save space in the application. So button1 displays JP1 & button2 displays JP2 exactly in the place of JP1.
The current Layout is BorderLayout.U can suggest in anyother llayout too like GridBag layout.
Netharam.
Happy middling with java.
 
Stu Glassman
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Definitely use a CardLayout.
-Stu
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!