LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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

Reply
 
Search this Thread
Old 05-26-2006, 08:38 AM   #1
megabot
Member
 
Registered: Aug 2005
Posts: 39

Rep: Reputation: 15
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.
 
Old 05-27-2006, 05:40 PM   #2
paulsm4
Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
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!
 
Old 05-29-2006, 05:13 AM   #3
megabot
Member
 
Registered: Aug 2005
Posts: 39

Original Poster
Rep: Reputation: 15
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.
 
Old 05-29-2006, 10:07 PM   #4
paulsm4
Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
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
 
Old 06-01-2006, 12:13 AM   #5
hack_in_box
LQ Newbie
 
Registered: Sep 2004
Location: India
Distribution: Fedora core1, PCQ Linux2004, SuSE8
Posts: 13

Rep: Reputation: 0
It can be done. each pane can have a panel as each tab that has been added works as a container. Hope this helps.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
openoffice tabbed browsing deggial Linux - Software 7 11-18-2010 07:15 AM
Help with Panels in Java please. Diederick Programming 1 07-07-2005 03:44 PM
no tabbed browsing in xemacs 21.4.15? markhod Linux - Software 0 12-10-2004 05:59 AM
Java menus (radio buttons) and panels titanium_geek Programming 6 01-07-2004 11:13 AM
Tabbed text editor Kovacs Linux - Software 5 09-04-2003 12:51 AM


All times are GMT -5. The time now is 08:10 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration