This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

GridBagLayout not show JTabbedPane right initially but is ok after clicking other tabs

 
albert kao
Ranch Hand
Posts: 252
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My test program below does not display the first panel which is on the first tab properly when it starts - every component is crammed together. i.e. does not look good.
Then I click the second tab which display the second panel properly.
Clicking the first tab will display the first panel properly.
I tried to solve this problem by calling "setVisible(false);" at the beginning of the program and calling "setVisible(true);" at the end of the program but to no avail.
Please help to make the first tab look good when my program starts.
 
Rob Camick
Ranch Hand
Posts: 2475
8
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Post your SSCCE the demonstrates the problem.
 
Maneesh Godbole
Saloon Keeper
Posts: 10971
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Add firstPanel & secondPanel to the JTabbedPane and then add the JTabbedPane to the JPanel
 
Darryl Burke
Bartender
Posts: 5115
11
Java Netbeans IDE Opera
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
albert, we don't have too many rules around here, but we do ask that you BeForthrightWhenCrossPostingToOtherSites

http://forums.oracle.com/forums/thread.jspa?threadID=2253362
 
albert kao
Ranch Hand
Posts: 252
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Darryl Burke wrote:albert, we don't have too many rules around here, but we do ask that you BeForthrightWhenCrossPostingToOtherSites

http://forums.oracle.com/forums/thread.jspa?threadID=2253362


I will BeForthrightWhenCrossPostingToOtherSites from now on.

http://forums.oracle.com/forums/thread.jspa?threadID=2253362
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic