• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Problems using JTree and JTabbedPane

 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I suspect this is an elementary problem, but I haven't found the solution yet. I'm working on a GUI consisting of a JTree on the left side of the frame and one of three tabbed panes in the center. Which of the three is displayed depends on which JTree node is selected. The tabbed pane occupies a panel which has been added to the center of the content pane. The JTree listener removes the current tabbed pane from the panel and adds the next one.

Sometimes this causes the new pane to be displayed, but often it does not. If I resize the window, or temporarily obscure it with another window, the correct pane is displayed, so I know the components are being successfully added to the right containers. For some reason the window is not being repainted. I've tried calling validate() on numerous components but I haven't noticed any difference.

Cany anyone tell me how to fix this?

Thanks,

Robert
 
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your description of what you are doing and what isn't working the way you want is very clear and concise. This part of java is much too wonderful to figure out what you must/might have missed to produce the symptoms you describe. So it's easier to make up something that behaves correctly and (hopefully) does what you want.
 
reply
    Bookmark Topic Watch Topic
  • New Topic