• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

JPanel inside a Jframe

 
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
 
Saloon Keeper
Posts: 10308
217
  • 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?
 
Bartender
Posts: 11445
18
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • 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 Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • 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
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!