• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

Using SetTabComponent for Tabs in TabbedPane

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
You can't expect to wield supreme executive power just because
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!