This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Using SetTabComponent for Tabs in TabbedPane Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Using SetTabComponent for Tabs in TabbedPane" Watch "Using SetTabComponent for Tabs in TabbedPane" New topic
Author

Using SetTabComponent for Tabs in TabbedPane

Santhosh Raj
Greenhorn

Joined: Mar 08, 2012
Posts: 25
Hi All Swing developers, Referring to the below line, if I set a Jbutton as the tabComponent using



The button covers a part of the tab while I can still see background of the tab. But my requirement is to set this Button component on the tab completely as if the button should cover the whole tab as if there should be no access to that tab.

Please help me with this as I could not find any solution till now.
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
might be possible, but would involve digging into the TabbedPaneUI, then it starts getting messy.

might be easier to use a CardLayout for the panels you have in the tabbedPane (which is similar to a tabbedPane without tabs),
then setting up a single row of buttons to sit on the top of the CardLayoutPanel, so it might look like a tabbedPane.
each button would 'CardLayout.show()' it's respective panel
Santhosh Raj
Greenhorn

Joined: Mar 08, 2012
Posts: 25
Hi Michael,
I really appreciate your idea and it might work fine.
But my requirement is to use only TabbedPane as I am skinning it using Synth PLAF.
So I need the functionality should be done only using TabbedPane.
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Using SetTabComponent for Tabs in TabbedPane
 
It's not a secret anymore!