Solved

JTabbedPane Layout

Posted on 2004-09-20
6
252 Views
Last Modified: 2006-11-17
My JFrame has a BorderLayout.
I am placing a JTabbedPane at the North.
I want that when the user selects a Tab (from JTabbedPane) , the components of JTabbedPane should be displayed in the  BorderLayout.LEFT.
How can this be done?
0
Comment
Question by:vibration2k
6 Comments
 
LVL 3

Expert Comment

by:nesnemis
ID: 12104519
what exactly do you mean?
0
 

Author Comment

by:vibration2k
ID: 12113277
I mean that I want to place the components of a tabbed pane at a particular position in my frame. The components of the JTabbedPane (Components of a Tab of the JTabbedPane) should not be placed by default.
0
 

Expert Comment

by:Jollina
ID: 12117540
use one or more panels and place things using gridbag layout.
Or you could use a GUI Designer with your ide, I prefer this one http://www.jetbrains.com/idea/index.html
0
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 
LVL 92

Accepted Solution

by:
objects earned 50 total points
ID: 12117736
Can't be done directly.

You could try using empty panels in your tabbed pane, and add a ChangeListener to switch the panel displayed in the LEFT (using a CardLayout)
0
 

Author Comment

by:vibration2k
ID: 12124388
Can you suggest me some example code to actually implement whatever you suggested?
0
 
LVL 92

Expert Comment

by:objects
ID: 12128853
Have a look at the following:

http://java.sun.com/products/jfc/tsc/articles/cardpanel/index.html

And have your ChangeListener do the panel switching accoring to which tab is selected.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question