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 set width of JTabbed pane to fit the tabs

I have 3 tabs in my JTabbedPane and I want to have them next to each other, like this: However, I didn't find how to automaticly set the width of the JTabbedPane, so that the tabs would fit next to each other, so I just set the width by…
kajacx
  • 12,361
  • 5
  • 43
  • 70
2
votes
2 answers

JAVA How to get Tab from JTabbedPane by mousePosition

Just came to this problem. Brings SSCE with me! :-) I would like to get the tab content (component) by double-clicking at its "Title". I give you this SSCE and in this scenario, I would like to receive the JLabel by double-clicking at the…
MrDoda
  • 123
  • 1
  • 2
  • 13
2
votes
1 answer

Update a JTabbedPane when item added to JList

I have two tabs in a Java program. One to add a stock and another to list stocks that I have created. I have tried to find away to update my list of items in the first tab when I a new item in my second tab. Any Ideas? I want the first tab to…
DevDavid
  • 25
  • 3
2
votes
1 answer

How can i change jtabbedpane selected tab background color

I tried most of the things to do this,using helps from this site,there have more related post about this question,but any of that questions not helped to me. I need to change jtabbedpane selected tab background color.i used this code to that,but…
jhone
  • 23
  • 5
2
votes
0 answers

Look and Feel for Java Swing

I am confused about look feel's reaction in java. Initially I have used synthetica blue moon look and feel in my java swing application, It works fine for my application. Later I have switched to jTatoo luna look and feel, It slows down the Jabbed…
lekshmi
  • 191
  • 1
  • 1
  • 6
2
votes
1 answer

JTabbedPane TabComponent default tab highlighting

I have a question regarding custom tab components in swing. The following code will add 3 custom tab components: public class TabbedExample extends JPanel { public static void main(String... args) { EventQueue.invokeLater(new Runnable() { …
Code Monkey
  • 78
  • 1
  • 8
2
votes
1 answer

Can't show table header of tabbed JTable

I have a JTabbedPane, which contains three tables in its tabs. The JTabbedPane, again, is in a JScrollPane. I want to show a fix table header, which is following the schema {"Client", "Action", "Location", "Value"}, for each table. While I was…
KJaeg
  • 698
  • 3
  • 7
  • 23
2
votes
1 answer

KeyListener doesn't work, my Jframe can not recognise my keyboard

I dont know why my application can not detect my keyboard. Application its a JFrame who implements SerialPortEventListener and KeyListener. In the Jframe of my application I have 1 Tabbed Pane with 2 Panels. When I press some buttons it doesn't…
Jackson
  • 31
  • 1
2
votes
2 answers

JTabbedPane indent

When using a JTabbedPane, how do you indent the tabs? Swing default output: ------- --------- ------ | A | | B | | C | ------------------------------ | | | | | …
brian_d
  • 11,190
  • 5
  • 47
  • 72
2
votes
2 answers

Java JTabbedPane, update others tab JLabel value?

I have 2 JTabbedPane. I am unable to refresh the data. PLease help, here is my code: pane1: //.. some codes... // This is the ButtonListener private class ButtonListener implements ActionListener { public void actionPerformed (ActionEvent…
web_starter
  • 87
  • 1
  • 8
2
votes
2 answers

JTabbedPane and it's tab transparency won't work

I've done several inspection and done research on how to make a single panel transparent so that the image underneath it will show but has been unsuccessful with panels on a JTabbedPane. I have setOpaque(false) and setBackground(new Color(0,0,0,20))…
heisenberg
  • 1,784
  • 4
  • 33
  • 62
2
votes
2 answers

Overlapping tabs with JTabbedPane

Using JTabbedPane we want to implement a design that requires tabs to be overlapping (illustrated in image that can be found here: http://imm.io/YAZ). Not exactly rocket science, but I can't seem to find a solution (not even after extensive…
2
votes
3 answers

Remove the JTabbedPane "currently selected" dotted line

How do you remove the dotted line around the currently selected tab on a JTabbedPane. For example: See the dotted line around it?
user238033
2
votes
1 answer

Drawing Graphics in a JTabbedPane

I am trying to draw bar and dot graphs in a JTabbedPane for an app I am making. I did some research and it seems other people are using the paintComponent(Graphics g) function to paint on all the visuals. However, I am not sure how to implement this…
Kevin
  • 31
  • 2
2
votes
2 answers

JPanel doesnt allow positioning component

So I have created 2 JFrames But then I realized 2 JFrames is not a good idea.So I added JTabbedPane and then tried adding as different tabs in form of 'JPanel. But I cant position the components the way I did in Jframe and it looks like this. But…
2FaceMan
  • 443
  • 2
  • 18
  • 34