• Post Reply Bookmark Topic Watch Topic
  • New Topic

JTabbedPane screws the GUI

 
linda lichelli
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
i'm experiencing a funny - not for me though - problem with JTabbedPanes. My program has a tabbed Pane with four tabs. in each i load several JPanels, Tables, toolbars etc.
What I'm experiencing right now is that the first tab shows the content of all the tabs together. That messes up my GUI allover.
i searched the forum and found this partial solution: old forum entry
it didn't help me out so far. thanks in advance for your help.
p.s. when i put the panel into a scrollpane, then into the tab, it works fine. is the problem somewhere within a container? i don't want that scrollpane.
cheers, linda
[ September 16, 2003: Message edited by: linda lichelli ]
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24213
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You haven't shown us your code, but the problem with the other post you're referring to is that the third tab contains heavyweight TextAreas instead of lightweight JTextAreas; JTabbedPane can't handle this properly. The easiest way to fix that code is to replace the TextAreas with JTextAreas inside ScrollPanes -- you'll then find it works just fine.
Another way to fix it which allows you to mix heavyweight and lightweight components inside a JTabbedPane is to use java.awt.Panels instead of JPanels to contain each tab; this also works fine.
I'm sure one of these solutions will be directly applicable to your problem.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!