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
2
votes
1 answer

adding new jpanel with default components in swing

can any one tell me how to add a panel in a jtabbedPane whenever i am clicking on a "add" button.Its like google chrome new tab.But the thing is ,the generated panel must contains some default components.Thanks in advance.
2
votes
1 answer

Assigning a different (new) JPanel to a JTabbedPane at run time

I have a JTabbedPane (say myTabPane) having one tab (lets take only one tab for clarity sake). While creating the JTabbedPane, I added a JPanel (say panel_A) to this tab. I have a button on this JPanel. The tab displays my JPanel perfectly with the…
user1639485
  • 808
  • 3
  • 14
  • 26
2
votes
1 answer

How to combine 3 GUIs

I have 3 separate GUIs that perform independent functions: ConverterGUI TransformerGUI GenerationGUI How can I combine them together in such a way that they would look like tabs?
Abiodun
  • 959
  • 6
  • 17
  • 38
2
votes
2 answers

add JTable to JTabbedPane?

I am trying to add a JTable to a JTabbedPane. It comes up fine, however, the titles for the columns are not visible. Here's the relavent bits and pieces of my code: JTabbedPane jp = new JTabbedPane(); static JTable t1 = new JTable(); static…
Primm
  • 1,347
  • 4
  • 19
  • 32
2
votes
4 answers

while disabling the tabs in Jtabbedpane, there is no change in the look and feel of that tab

I am using a JTabbedPane. In this i have to disable some tabs. i disable the tab using setEnabledAt(index,false) method. the tab was actually disabled but i don't get look and feel [the color of the disabled tab text become light color]. how do i…
Siddhu
  • 1,188
  • 2
  • 14
  • 24
2
votes
2 answers

HTML to fire JTabbedPane switch tab

Right now the goal I would like to acheieve is to have the HTML links(which each have a tab dedicated to them) fire the setSelectedComponent JTabbedPane function. In other words rather than jump down to the section on the "All" tab(which is what…
KisnardOnline
  • 653
  • 4
  • 16
  • 42
2
votes
4 answers

Colorize a tab in a JTabbedPane using java swing

I am trying to change the background color of my tabs in a JTabbedPane. I tried JTabbedPane.setBackgroudAt(0, Color.GRAY) and JTabbedPane.setBackgroud(Color.GRAY) and the foreground too, but nothing happens. I changed the background of the panel…
evandrobm
  • 445
  • 1
  • 7
  • 17
2
votes
2 answers

What's wrong with JSplitPanel (or JTabbedPane)?

I have two panels that i wish to display to the user. I decided to add them to a JTabbedPane. I also want to allow the user to have a side by side view of them both at the same time. So I added the two panels to my JTabbedPane and then i created a…
Savvas Dalkitsis
  • 11,476
  • 16
  • 65
  • 104
2
votes
3 answers

In Java how do you trap the event before the new JTab is switched to?

how do you trap the event before the new tab is switched to? In every Tab I have JTable and i do something with it's data(delete, add , update). I would like to do data validation(save or cancel changes) before switching to the new tab. I use Java…
itro
  • 7,006
  • 27
  • 78
  • 121
2
votes
1 answer

Tab in JTabbedPane does not reflect changes on button press

Within a tab of my GUI, the user is allowed to edit an employee's name. The name also serves as the tab's label, so when the change is confirmed the tab should be updated to reflect this change and the new data is written to a data file. The…
A D
  • 789
  • 1
  • 12
  • 29
2
votes
2 answers

java swing TabbedPane position tabheaders bottom right to left

I wonder if there is any possibility to position a Tabbed pane to the bottom right, I want to make to containers above each other, the one with the tablabels at the top right to left (no problem/default), and the other one with the tablabels at…
ted
  • 4,791
  • 5
  • 38
  • 84
2
votes
5 answers

After calling JTabbedPane.removeAll(), the JTabbedPane still has x number of tabs?

In my JTabbedPane, I am removing tabs in 2 different ways: tabbedPane.remove(index) and tabbedPane.removeAll() Both work fine in terms of closing the tabs. However, I have a change listener on my TabbedPane that calls back to another module to…
thedude19
  • 2,643
  • 5
  • 34
  • 43
1
vote
1 answer

how to refresh data in JTabbedPane?

sir/mem , how to update the images content in the jLabel ,and how to refresh the this JTabbedpane , that contain Jlabel?
Jay
  • 1,235
  • 10
  • 28
  • 49
1
vote
1 answer

JTabbedPane's tab area add a button, it can display, but it can't click

I have a JTabbedPane with tabs on the top. To the right of the tabs, I add a button. This button is neither part of JTabbedPane nor is it a tab. Unfortunately, it cannot be clicked. I guess this button is covered by the JTabbedPane, because I moved…
chenhai
  • 35
  • 4
1
vote
2 answers

Modify the scroll button of a JTabbedPan

I'm working on a UI on Java with Swing, I want to change the scroll button of a JTabbedPane, so I use a new UI (MyTabbedPaneUI) that I create from the extends MetalTabbedPaneUI. But when I create my JTabbedPanel there are 2 tabs which appear and I…
Fred37b
  • 822
  • 2
  • 10
  • 29