🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #1249

Re: how to use the free space available in the right of the JTabbedPanels?

#1249
From: John McGrath [TeamB]
Date: Sat, 28 Feb 2004 22:45
36 lines
2447 bytes
On 2/20/2004 at 9:16:06 PM, Adrian Pitulac wrote:

> I was wondering if i can use the free space on the screen available
> when i use a JTabbedPanel and i don't have so much tabs for all the
> horizontal size of the JTabbedPanel. I want to use it for some
> buttons and some logos....

JTabbedPane does not provide that functionality, so there is no easy
way to get the effect you want.  If you are *very* determined, it would
be possible, but I would not recommend it.

One way would be create a panel and place it above the JTabbedPane.
You could place this in the same container and have the layout manager
control the position.  Or you could place the panel on the layered
pane.  In either case, you would need to monitor the JTabbedPane for
changes in size or position and make the necessary adjustments.

The other approach would be to create a subclass of JTabbedPane that
would allow you to add components to that area.  This would probably
involve messing with the UI delegate, which would not be simple.

> Also how can i add the buttons to navigate over the tabs? I have seen
> such applications and those buttons were in that empty space i was
> talking about.  Which is the best method to navigate between tabs?

Have your buttons call the setSelectedIndex() or setSelectedComponent()
method on the JTabbedPane.

-- 
Regards,

John McGrath [TeamB]

---------------------------------------------------
Before sending me e-mail, please read:
    http://www.JPMcGrath.net/newsgroups/e-mail.html
Technical Details
Message-ID: <40411a26$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <4036bf5c@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,5dda87d8cd6a82c5
X-Google-Attributes: gid111d45,public
X-Google-ArrivalTime: 2004-02-28 14:57:59 PST
From: "John McGrath  [TeamB]" <ng-b@JPMcGrath.net>
Subject: Re: how to use the free space available in the right of the JTabbedPanels?
Newsgroups: borland.public.jbuilder.java.swing
References: <4036bf5c@newsgroups.borland.com>
User-Agent: XanaNews/1.16.1.11
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-15
NNTP-Posting-Host: 151.197.239.170
Message-ID: <40411a26$1@newsgroups.borland.com>
Date: 28 Feb 2004 14:45:58 -0800
X-Trace: newsgroups.borland.com 1078008358 151.197.239.170 (28 Feb 2004 14:45:58 -0800)
Lines: 36
X-Authenticated-User: jpmcgrath
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail