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

TabbedPane iterate for loop

I received in loop iteration as: Tab 1 Tab 2 On beginning code I have panel, tabbedpane and scrollpane: JPanel panel = new JPanel(); JTabbedPane tabbedPane = new JTabbedPane(); JScrollPane scrollPanel = new JScrollPane(); Then receive through…
Marin Sagovac
  • 3,932
  • 5
  • 23
  • 53
2
votes
1 answer

JTabbedPane track previous tab selection

I have a class that extends BasicTabbedPaneUI and does some paint component overriding. I want to be able to add a addMouseListener to the class I use it in to check when the user selects a tab the current tab index and the previous tab…
haz hazzz
  • 103
  • 2
  • 8
2
votes
1 answer

Cannot change active tab in Swing, "Non static method cannot be referenced"

I'm currently having an issue with Swing, where I am trying to get a button from Tab 1, once clicked on, to go to tab 2. The two blocks of code that are at work here, as far as I know, are as follows: // Variables declaration - do not modify …
user3563753
2
votes
2 answers

What is causing slow performance in my JTabbedPane-based Swing application?

I have a Swing application for creating RPG characters. It has a nested JTabbedPane architecture, so there is a HeroTabsPanel which has HeroPanels and each of those has some more tabs like Stats, Items etc. So the GUI is comprised of the upper…
Alex Kamen
  • 61
  • 7
2
votes
1 answer

How to add a label to the extra space on a tabbed pane

I am trying to add a JLabel to the blank space of a JTabbedPane (to the right of the tabs and above the content panel). I was very close with this SSCCE (using MigLayout): public static void main(String[] args) { try { …
ryvantage
  • 13,064
  • 15
  • 63
  • 112
2
votes
1 answer

JTabbedPane, Jpanel and Gridbaglayout

I want to create a JTabbedPane for separate items, with JPanel and GridBaglayout, but every time, the second tab of the JTabbedPane bug my text field objects... that is my animal register class, the extended class and the main class the problem is…
2
votes
1 answer

Spacing Between JTabbedPane

In this JTabbedPane screenshot I am using DnD of Netbeans, and I've been tinkering around it just to put spaces between the tabs. So far I still can't get what I want. Is there a way to do it?
2
votes
0 answers

Java CEF browser only loading when tab is selected

I am trying to create a browser on each tab using CEF, but I am finding that the content will only load once a tab is selected. Is the any way of getting the content of the tab to load in the background without the tab being selected. import…
Paul
  • 1,375
  • 4
  • 16
  • 29
2
votes
1 answer

How to remove indents in the tabs JTabbedPane?

How to remove the indents around icon tabs in JTabbedPane? i.e. what would this icon was on the full size of the tabs?
silverhawk
  • 569
  • 1
  • 6
  • 14
2
votes
2 answers

JTabbedPane swing update error

I have 2 JPanels in a JTabbedPane and when update(g) is called on a panel inside the first panel (Its an animation) even if the second panel is the selected panel(i.e the one you can see) the updated panel appears on the screen. Why is this and how…
dominic
  • 468
  • 1
  • 5
  • 14
2
votes
1 answer

How to extend JTabbedPane to always have an "Add Tab" tab?

I am trying to create a JTabbedPane so that the final "tab" is actually a button that will open up a dialog box to add something to the tabbed pane. I tried looking around the source for JTabbedPane, but I can't find where the tab objects (the row…
user450775
  • 467
  • 1
  • 5
  • 14
2
votes
2 answers

Mac JVM rendering JTabbedPane differences between 1.6 and above

This is how JTabbedPane renders in Java 1.6: When using Java 1.7 (or 1.8 EA), see the bottom of the tabs getting clipped: I tried, without any success (or effect) the system properties -Dcom.apple.macos.smallTabs=true and…
Subhash Chandran
  • 1,275
  • 1
  • 13
  • 20
2
votes
2 answers

JTabbedPane without Tab header

Hi guys i writing an app that have JTabbedPane in it. but the problem is it's always have tab header on it. i want to remove that tab header and make JTabbedPane look like an rectangle one. Here my code: public final static JTabbedPane…
KaJasB
  • 2,325
  • 2
  • 11
  • 10
2
votes
1 answer

JTabbedPane within JScrollPane only showing one item at a time

When I launch my application, it launches the JFrame and loads up the JTabbedPane which contains the JScrollPane, yet it only shows one component inside it at a time. I have tried everything, and still I cannot solve the problem... Here is my…
gedr
  • 316
  • 1
  • 2
  • 12
2
votes
2 answers

How do I remove "tab borders" in JTabbedPane

I would like to remove the lines drawn around just the "tab" at the top. So I am on left with the label text. How can I do this? I HAVE SEARCHED extensively but nothing works for me.
ManInMoon
  • 6,795
  • 15
  • 70
  • 133