• Post Reply Bookmark Topic Watch Topic
  • New Topic

JPanel inside a Jframe  RSS feed

 
Georgios Chatziefstratiou
Ranch Hand
Posts: 106
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there

I have a Jframe and i want to add inside 4 different jpanel.
This is easy.

what is difficult is how can i change them dynamically with 4 other new jpanels and 4 other new jpanels?
I have try with BorderLayout but not working.
It's a wizard like but not the same.
I have a jpanel with jbuttons jpanel with a jtable jpanel with textarea and jpanel with jlabels.
All this have to change with other 4 jpanels any idea where to look?


thanks
 
Stephan van Hulst
Saloon Keeper
Posts: 6981
110
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at CardLayout. It's here at the Oracle tutorials: http://docs.oracle.com/javase/tutorial/uiswing/layout/card.html
 
Georgios Chatziefstratiou
Ranch Hand
Posts: 106
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stephan van Hulst wrote:Take a look at CardLayout. It's here at the Oracle tutorials: http://docs.oracle.com/javase/tutorial/uiswing/layout/card.html



I have seen it but no luck.
something else in mind?
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Georgios Chatziefstratiou wrote:
I have seen it but no luck.
something else in mind?

ItDoesntWorkIsUseless Please TellTheDetails
 
Georgios Chatziefstratiou
Ranch Hand
Posts: 106
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maneesh Godbole wrote:
Georgios Chatziefstratiou wrote:
I have seen it but no luck.
something else in mind?

ItDoesntWorkIsUseless Please TellTheDetails


Look at this



and this



This is with parent frame but with no luck.

Do you have any idea where to look to implement this somehow else?And not with a layout.

thanks i advance
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you wish to add/remove child components from a parent which is already being displayed, call a revalidate() and a repaint() (in that order)
 
Georgios Chatziefstratiou
Ranch Hand
Posts: 106
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maneesh Godbole wrote:When you wish to add/remove child components from a parent which is already being displayed, call a revalidate() and a repaint() (in that order)


i will try it
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!