Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
05-26-2006, 08:38 AM
|
#1
|
|
Member
Registered: Aug 2005
Posts: 39
Rep:
|
Tabbed Panes and Panels in Java
Hello,
I want to use Tabbed Panes in Java, in every TabbedPane (in this case 3 TabbedPanes) I wand to add a different Panel, each Panel will be represented by a different class. For example:
- TopChoicePanel.java
- MiddlePanel.java
- BottomPanel.java
Is it possible to add a different Panel to each TabbedPane. For example; when I click on TabbedPane1 it shows TopChoicePanel, when I click on TabbedPane2 it shows MiddlePanel etc.
What is the best way to do this? ItemListener perhaps? Any suggestions would be appreciated, thanks in advace.
|
|
|
|
05-27-2006, 05:40 PM
|
#2
|
|
Guru
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,861
Rep: 
|
Hi -
I don't understand the question. What exactly are you trying to do?
Suggestion:
Forget about implementation details like "Tabbed Panes" and "Panels" for a moment. Pretend you don't know anything about Java or Swing.
Tell us in high-level terms what you'd like this user interface to look like, and what it needs to do.
I'm guessing that the solution might actually be quite easy!
|
|
|
|
05-29-2006, 05:13 AM
|
#3
|
|
Member
Registered: Aug 2005
Posts: 39
Original Poster
Rep:
|
I want to create a screen on which I have 4 buttons or 4 tabs on the top, from which I can switch to 4 other screens. Every other screen will be represented by a different class.
I can either make 4 buttons or a Choice list on the top to switch between these 4 screens(panels), but I thought I would give tabs a try.
So what I mean, if I use tabs, is it possible to connect an ItemListener or anything of that kind to the tabs. For example, when I use a Choice, I can use an ItemListener to the Choice so that I may switch between the choiceitems. How does this work with Tabbed Panes?
I hope this is clear.
|
|
|
|
05-29-2006, 10:07 PM
|
#4
|
|
Guru
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,861
Rep: 
|
Suggestion - try a set of four simple panels, organized with a CardLayout (which stacks stuff on top of each other). That might be the easiest approach.
Here's an example:
http://java.sun.com/docs/books/tutor...yout/card.html
Just a thought .. PSM
|
|
|
|
06-01-2006, 12:13 AM
|
#5
|
|
LQ Newbie
Registered: Sep 2004
Location: India
Distribution: Fedora core1, PCQ Linux2004, SuSE8
Posts: 13
Rep:
|
It can be done. each pane can have a panel as each tab that has been added works as a container. Hope this helps.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 09:33 AM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|