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
3 answers

Content of JTabbedPane shifting after switching back

While working on a school project, due this saturday, I encountered the most annoying bug I've ever encountered yet. I can't seem to find a solution anywhere on the World Wide Web. Even my good old friend Google seems to let me down. So, here's the…
Scuba Kay
  • 2,004
  • 3
  • 26
  • 48
3
votes
2 answers

Display output in a tabbed window

I have developed a task manager for Linux in Java. The output as of now is displayed in the console whereas a tabbed window appears separately (this was done using Java Swing). Now I want the output from the console to be displayed in the tabbed…
celebrate celeb
  • 75
  • 1
  • 3
  • 10
3
votes
1 answer

JTabbedPane Transparency

How do you set the actual content pane's background to be Opaque, the panels that I add to it I have already set Opaque but the tabbedpane main area keeps showing up as blue even when I do JTabbedPane tabbedPane = new…
sl133
  • 1,339
  • 2
  • 15
  • 28
3
votes
2 answers

Close the clicked tab, not the currently selected tab JTabbedPane

I have this class inside my main class to put a close button on my jTabbedPane. The problem is that, for example I have opened three tabs: tab journal, contact, and upload , and the tab contact is the currently selected tab. When I try to close the…
John
  • 836
  • 2
  • 25
  • 39
3
votes
2 answers

JTabbedPane how to determine that user left tab?

I wonder, if it possible to determine, that user left certain tab. For example, we have 2 tabs: "omg" and "lol". The current tab is omg. I want to know that user switched from "omg" to "lol"
mr.nothing
  • 5,141
  • 10
  • 53
  • 77
3
votes
1 answer

After losing the focus on the JPanel screen in swing, screen don't show the content

I am using JTabbedPane with JPanel to display JTable on one tab and text, dropdown and jbutton on other tab. First time it is working fine but if i minimize or switch screen to other application and come back to my application it display data…
2
votes
1 answer

Firefox 'Open new tab' on JTabbedPane

I want to add a button to JTabbedPane's title bar (similar to the 'open new tab' ('+') button in Firefox) I have tried to add to the glass pane of JTabbedPane's container. but since my tabbedpane contains within a JPanel seems it doesn't work for…
Thudani Hettimulla
  • 754
  • 1
  • 12
  • 32
2
votes
1 answer

Creating Customized TitleBar and Tabbed Panes in Java Application

I am working on the UI for a particular java application. I need to create a UI like this, can someone direct me as to what all to use to create this: I am Sorry for the Paint Image. Hope it does the Purpose:-|. What I specifically need is - The…
nikel
  • 3,402
  • 11
  • 45
  • 71
2
votes
1 answer

Change tab name

I would like to change tab name by clicking on "Rename" item from a popup menu by adding an ActionPerformed, and type directly on tab the new name. I have found this jTabbedPane.setTitleAt(count, "string here"); but it is not what I want, this just…
Alberto acepsut
  • 1,972
  • 10
  • 41
  • 87
2
votes
3 answers

How to prevent leaving a Tab on JTabbedPane

I have an application that has nested JTabbedPanes. Each of the JTabbedPanes include other JTabbedPanes. I want to check something before allowing the user to leave the current tab. When you run the code below, you'll see that the Months->February…
bigleftie
  • 453
  • 1
  • 6
  • 17
2
votes
2 answers

How to remove a tab from a tab pane

I have created a swing application as bellow which shows main tasks in tabs when clicking the buttons which are related to specific tasks. I have added a small close button to each tab and what I need to to is close the tab when clicking the close…
Harsha
  • 3,548
  • 20
  • 52
  • 75
2
votes
1 answer

accessing data from a different Tab in a TabbedPane - Java

i have a JTabbedPane with several tabs, each of them is a class that extends JPanel, and contains a layout (textfields and labels for example). i been trying to reach the data from various tabs, but i cant figure out how to do it. my goal is to…
Zephyer
  • 333
  • 6
  • 16
2
votes
1 answer

Display the first tab of a JTabbedPane

I have a Jtabbedpane which contains 4 tabs (each one a Jpanel). When I run the application from netbeans 6.8 the selected tab will be the same one as it was selected before closing the application. Is there a way to select the first tab (index 0)…
Joe123
  • 103
  • 3
  • 10
2
votes
1 answer

How set different colors for different selected tabs of a JTabbedPane?

I'm trying to create a JTabbedPane with tabs that will have different colors when selected. For example, let's say I have tabs A, B, and C. If a tab is not selected, then the tab color will be the default. If tab A is selected, then the tab color…
2
votes
1 answer

JXMultiSplitPane going bonkers when I switch tabs

I'm using JXMultiSplitPane (from SwingX 1.6.2) to implement a three-pane horizontal interface. In the center pane is a JTabbedPane with two tabs: one with a JTextArea (in a JScrollPane, of course) used for entering Markdown code and the other a…
James Jensen
  • 363
  • 3
  • 8