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

How to add a JScrollPane onto a JTabbedPane using a null layout?

I want to implement a Scrollbar onto my Tab. However nothing is showing and there are no exceptions. I think I need a: scrollPane.setViewportView(scrollPanel); But it didn't work as well. I am wondering when adding a Jscrollpane onto a JTab how…
Jebathon
  • 4,310
  • 14
  • 57
  • 108
2
votes
1 answer

How can I hide a JTabbedPane once it's been shown?

I recently re-wrote a lot of my application, and before I did so what I'm trying to accomplished worked just fine. I'm trying to hide a JTabbedPane on demand, via a JCheckBoxMenuItem in a JMenuBar. What I did before seemed to be exactly the same,…
Aeterna
  • 103
  • 1
  • 9
2
votes
1 answer

JTabbedPane Component takes up entire window

I'm new to Java and the entire swing development. I'm working on a Window with three tabs and adding each component to those tabs. I started by adding a textfield to the 3rd tab, but it's taking up the entire tab. I'm sure if I add other…
Marquisk2
  • 159
  • 1
  • 15
2
votes
2 answers

Java - how do I gain focus on JTextArea when selecting a new JTabbedPane

I have a swing GUI with multiple JTabbedPanes; each tab contains two JButtons at the top, then a JTextArea (for user input), and a JTextField at the bottom for a result. My problem is that I can't get the JTextArea to gain focus after switching tabs…
user1938204
  • 77
  • 1
  • 5
2
votes
3 answers

Adjust tabs in jTabbedpane

Im using a jTabbedpane for my application. In normal window size, its like this. But when its maximized, Its like this. (Tabs do not change their size). I want to adjust tabs as to distribute evenly in any window size. Thank You.
Hasi007
  • 146
  • 2
  • 14
2
votes
1 answer

Retrieving content of Textarea within a JTabbedpane

am writing a swing application that uses JTabbedpane. Can open a log file in a tab and 'parse it' as required to another tab. Am having trouble though saving the parsed content to a text file. Each tab consists of a JTextarea within a JPanel.
blowie
  • 21
  • 2
2
votes
0 answers

JTabbedPane with close button in netbeans

I am working with JTabbedPane in netbeans 7 so i need to add close button on every tab. how can i add close button in the tab in netbeans. I just want to make tab like netbeans. thanks in advance.
user591790
  • 545
  • 2
  • 15
  • 33
2
votes
1 answer

Add a JButton inside a JTabbedPane tab

Possible Duplicate: Adding a button component to a java tabbed pane in java Is it possible to add a button to a JTabbedPane tab (the tab itself) so that when clicked it could perform an action, for example close the tab?
user1724416
  • 914
  • 2
  • 11
  • 24
2
votes
1 answer

Close an Opened JInternalFrame that is been opened within another JInternalFrame while changing the tab of a JTabbedPane

I've created and application in which there are two tabs titled Tabbedpane 1 and Tabbedpane 2. In one tab body Tabbedpane 1 contains a JInternalFrame in which there is a search button. On clicking the button another JInternalFrame opens within the…
Nidhish Krishnan
  • 20,593
  • 6
  • 63
  • 76
2
votes
2 answers

Jtabbedpane using multiple classes

I'm fairly new to java and am creating a windowbuilder program. I am wondering if it is possible when using Jtabbedpane and switching between the tabs in the program window if i can use an actionlistener to get the contents from a separate class.…
Preston
  • 33
  • 1
  • 4
2
votes
1 answer

JToolBars in JTabbedPanes; incorrect tab name when docked and undocked

I'm quite new to event listening and GUI's, so am having trouble figuring this out. I have a JTabbedPane to which I have added 3 components. These components are JToolBars, which allows me to drag them out of the JTabbedPane into a floating window.…
jdn
  • 33
  • 6
2
votes
1 answer

which kind of object a tab is?

well first of all let me explain what i mean, and what I'm intending to do, I already know (and did) that in order to modify the appearance of the tabs in a TabbedPane, i need to extend XTabbedPaneUI (X = Basic,or any TabbedPaneUI you wish to…
Ordiel
  • 2,442
  • 3
  • 36
  • 52
2
votes
1 answer

Tabs' position of JTabbedPane

I would like to know how can I set the tabs' position of JTabbedPane starting from the left.By default they are in a central position because i use Mac OS X. If you need more info please let me know. see this image to get an idea of what I get in my…
Issam2204
  • 69
  • 1
  • 1
  • 4
2
votes
1 answer

Horizontal Scrolling in Swing

I am having some problems figuring out how to make the outlined red part in the screenshot below using Swing. It's a GUI issue. Specifically I'm doing a little project about TV Series and I don't know how to show the characters' name in a horizontal…
Issam2204
  • 69
  • 1
  • 1
  • 4
2
votes
1 answer

Java JTabbedPane can't add multiple tabs?

I'm re doing a specific application, just a basic text editor and I remember I had tabs and a JMenu so if you went File --> New it would add or 'Open' another tab on the JTabbedPane. But this time it's not doing it for me, could someone help? Here…
NardCake
  • 130
  • 2
  • 9