Skip to main content
gamedev.net
🔒 Locked

[java] JTabbedPane question?

Started by JDev Feb 26, 2005 at 2:22 AM 0 replies 600+ views
Original Post
JDev
JDev
Hello, I'm having a problem with my Java gui. I want to have my class that implements JFrame to have a side panel. I want this side panel to be a certain width and I want to fill that JPanel with a JTabbedPane. I've currently got that covered, but I can't resize the JTabbedPane object, it's always half of the screen. I'm using a BorderLayout Layout manager for the JFrame and gridLayout for the JPanel that contains the JTabbedPane object. What method and where do I call it to resize the JTabbedPane to be a certain distance wide...? help! thanks, JDev
CaptainJester
CaptainJester
On the JPanel that contains the JTabbedPane, use BorderLayout and add the JTabbedPane to the center of the layout. Then set the size of the JPanel. This will force the JTabbedPane to be the size of the JPanel.
"None of us learn in a vacuum; we all stand on the shoulders of giants such as Wirth and Knuth and thousands of others. Lend your shoulders to building the future!" - Michael Abrash[JavaGaming.org][The Java Tutorial][Slick][LWJGL][

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.