Questions tagged [jtabbedpane]

A Java Swing component that lets the user switch between a group of components by clicking on a tab with a given title and/or icon.

A Java Swing component that lets the user switch between a group of components by clicking on a tab with a given title and/or icon.

JTabbedPane may have tabs header along any of the four edges. Each tab header consists of the name and optional icon. Clicking on the tab header brings the associated tab to the top. The tab itself can any any single component (most often it is JPanel). Tab components are added to the tabbed pane like keys to the map:

tabbedPane.addTab("My tab", myComponent);

Duplicate tabs headers are possible but usually not used as they may be confusing. JTabbedPane also has methods to remove tabs and replace the tab header texts or icons.

For examples and information on using tabbed panes see How to Use Tabbed Panes.

824 questions
3
votes
2 answers

Why these three panels using GridBagLayout use extra space differently, and how to make them uniform

I have an application that has multiple panels; I would like to have the freedom to use different layout managers for the different panels, but would like them to behave similarly as the window is resized by the user. package example; …
arcy
  • 12,845
  • 12
  • 58
  • 103
3
votes
1 answer

ButtonTabComponent adds AquaTabbedPaneCopyFromBasicUI$TabContainer in JTabbedPane

Im basicly trying to add in a bunch of JPanels in each tab in the jtabbedpane, and it works fine on its own. But when following the Javatutorial on adding closingbuttons to each tab, it adds this weird tabContainer to the jtabbedpane after the…
Hwestman
  • 33
  • 5
3
votes
3 answers

JTabbedPane: avoid automatic re-ordering tabs if stacked / Nimbus

a JTabbedPane is just what I need for my purpose. I have very limited horizontal space, so my Tabs get stacked, which is perfectly ok. But the default behaviour is that if user clicks on a Tab, the *Tabs get re-sorted so that the active Tab becomes…
Philippp
  • 847
  • 1
  • 8
  • 17
3
votes
1 answer

How do I tell if the tab that I have open is the active tab in java?

I have a panel inside a jtabbed pane that I only want to refresh if the tab is visible. I tried, isShowing(), isDisplayable() and isVisible() and none of them seem to work as they check whether or not the component COULD be showing, displayable or…
davidahines
  • 3,976
  • 16
  • 53
  • 87
3
votes
1 answer

How can I disable the white color in JTabbedPane?

I am trying to customize Colors in a JTabbedPane. I've tried everything and nothing seems to work. I need to change the white color in the image. Please help. image here and this is my code UIManager.put("TabbedPane.contentBorderInsets", new…
Wadia SALEM
  • 101
  • 2
  • 6
3
votes
3 answers

Can I put some tabs to the left and others to the right in a JTabbedPane?

Can I put some tabs to the left and others to the right in a JTabbedPane? Or at least to add some tabs, then add an empty space, and then add other tabs? Thanks!
radonys
  • 597
  • 1
  • 9
  • 20
3
votes
1 answer

How does one make a component in the .CENTER of a Borderlayout occupy all center space and resize with the app?

My app/JFrame, using Borderlayout, has a toolbar at the top or north, a statusbar at the bottom or south and a JPanel.JTabbedPane.JScrollPane.JTable in the center. The JPanel is always a fixed size which is roughly adjustable using the various…
alm
  • 33
  • 3
3
votes
1 answer

How to place components beneath tabs in right oriented JTabbedPane

So I just stumbled across placement of tabs in a JTabbedPane to the right and left (i.e. setTabPlacement(JTabbedPane.RIGHT)) which I love the look of. What I need is to utilize the space this leaves beneath the tabs. I currently have a column of…
3
votes
1 answer

JTabbedPane - How to scroll (not select) tabs with mouse wheel (SCROLL_TAB_LAYOUT)

When space is limited, the tabs get shown in a scroll pane, and two small arrow buttons appear. I would like to use the mouse wheel to operate these buttons. There is a nice solution in Use mouse to scroll through tabs in JTabbedPane, but it…
Philippp
  • 847
  • 1
  • 8
  • 17
3
votes
1 answer

JTabbedPane component accessing

I use JTabbedPane in one of my Java GUI code. I use the following portion of code to instantiate and maintain the tabpane. JTabbedPane tabpane = new JTabbedPane(); PageViewer pv = new PageViewer(); tabpane.addTab("tabttitle", new…
Farhan Nasim
  • 773
  • 4
  • 13
3
votes
2 answers

how to change the color of text of tab on mouse over of JtabbedPane?

I need to change the color of text of tab of JtabbedPane on MouseOver. Is is possible using the Mouse Listener or is there any different property to do that? Thanks Jyoti
Jyoti
  • 2,065
  • 3
  • 25
  • 28
3
votes
2 answers

How to add button in JTabbedPane background?

I want to add button in my JTabbedPane background like Google Chrome so that every time I can add new tabs by clicking it. How can I do it? Thanks in advance! EDIT: I have taken an undecorated JFrame.
IAmBlake
  • 457
  • 6
  • 21
3
votes
1 answer

JTabbedPane tabs

Alright, so I have a JTabbedPane in an application and it has several panels. Is it possible to assign a JPopupMenu to the actual tabs themselves instead of the JPanel? If it is possible, how would I do this?
user372743
3
votes
2 answers

Java Hidden JTabbedPane

I want when I click on tab1 or tab2. Japel display will hide or show,I want the results shown in Figure 2.I use the command jPanel2.setPreferredSize(new Dimension(0, 0)); Ex: If I have 10,I need setPreferredSize for 10 japanel with each tab.I want…
Ma Tâm
  • 307
  • 4
  • 20
3
votes
1 answer

JTabbedPane tab border removal

JTabbedPane - tab border is being shown even after using BasicTabbedPaneUI. Please let me know how can I change such that no border is shown between the tabs? Is there any method to remove the border completely ? Please Send me the code snippet.…
user3781572
  • 175
  • 1
  • 4