Board index » jbuilder » how to use the free space available in the right of the JTabbedPanels?

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


2004-02-21 10:16:06 AM
jbuilder13
Hello,
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....
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?
Thanks in advance.....
Adrian
 
 

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

On 2/20/2004 at 9:16:06 PM, Adrian Pitulac wrote:
Quote
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.
Quote
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:
www.JPMcGrath.net/newsgroups/e-mail.html