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
0
votes
2 answers

Java. Cant add JPanel in JScrolledPane

I'm adding JTabbedPane to JFrame. Each tab contains a different bgPanel (JPanel with drawn image as background), each bgPanel contains JScrollPane, and each JScrollPane contains a JPane (nowyPanel). bgPanels are only a background. Each JScrollPane…
0
votes
1 answer

Sharing Components with multiple containers

I have JTabbedPane and each tab has a JTextPane. Each JTextPane has a popup-menu but I want all of them to share the exact same popup-menu. Why? Because when I switch tabs, I want the same options to be highlighted on each popup. How can I do this?…
Brandon
  • 22,723
  • 11
  • 93
  • 186
0
votes
2 answers

Tabs in a JTabbedPane affect the content

Why would the order of Tabs in a JTabbedPane affect if the content of the tab works as expected? I am writing my first advanced application and am having some trouble with my JTabbedPane. Here's what I have: public ProjectTracker() { …
phischer
  • 1
  • 1
0
votes
1 answer

Refresh JPanel content on tab switch

I'm writing a simple UI just to get the hang of things. I have a tabbed window with two tabs, one has a button that counts up an integer, the other has a text field showing the content of said integer. Or at least that's the plan. Everything works…
Conti
  • 111
  • 2
  • 6
0
votes
1 answer

Netbeans visual editor suddenly flawed

I am currently developing a small application for my exams next month. I am using the visual editor of Netbeans. Suddenly it stopped working, giving me the exception at the end of the thread. It appears it has something to do with my Tabbed Pane…
Patrick Reck
  • 11,246
  • 11
  • 53
  • 86
0
votes
1 answer

AWT TextArea inside JTabbedPane visual bug

JTabbedPane main_tabbedPane = new JTabbedPane( JTabbedPane.TOP ); main_tabbedPane.setBorder( new EmptyBorder( 0, 0, 0, 0 ) ); main_tabbedPane.setBounds( 10, 76, 665, 473 ); main_tabbedPane.setVisible(false); main_content.add( main_tabbedPane ); //…
user2012652
  • 41
  • 1
  • 3
0
votes
1 answer

Using JButtons as Tabs

Could I use JButtons as tabs? Since the JTabbedPane cannot hold the same component in multiple tabs, would there be a way for a JButton to be a tab? I know it looks like tiDE(Website) uses the JButtons as a tab. How would I do that? I could make…
user2228462
  • 589
  • 1
  • 5
  • 14
0
votes
1 answer

Is it posible to place the tabs within JTabbedPane(JPanel)?

Like this! And the setOpaque(false); in JTabbedPane didn't work. Would someone help me please? part of my code: for (int x=1; x<6; x++){ newsPanel[x]=new JPanel(); newsPanel[x].add(newspicLabel[x]); NewsTab.addTab("",…
0
votes
1 answer

JButton inside JTable inside JTable inside JTabbedPane

So the code behind it is quite massive. I have JTabbedPane with a Tab for each table(inside JSCrollPane ) and a Summary table which contains tables that uses the same models as models in the tabs. So when I add rows to the table everything renders…
user1633277
  • 510
  • 2
  • 7
  • 14
0
votes
1 answer

JTabbedPane with autoscrolling Tabs

If I use this function more than once in the programm the tabs stop autoscrolling. Autoscrolling woks with one Tab: protected JTextArea addTab(String name){ JTextArea tab = new JTextArea(); tab.setEditable(false); JScrollPane scroller =…
Mischa
  • 1,591
  • 9
  • 14
0
votes
1 answer

problem with putting things inside a tabbed pane

I need to put check boxes inside tabbed panes, but they are always on the outside like this alt text http://img340.imageshack.us/img340/3786/87088242.jpg I want to put the murder check box inside the Input tab. This is what I have in my code import…
Karen
  • 275
  • 2
  • 7
  • 14
0
votes
2 answers

How to stop JTextArea from being placed on top of JTabbedPane?

I am trying to design a layout with a JTabbedPane at the top of the frame and then a jLogArea below the tabbed pane. I am using this code: setLayout(new BorderLayout()); tabbedPane.setSize(WIDTH, HEIGHT); add(tabbedPane,…
Dan
  • 3,879
  • 5
  • 36
  • 50
0
votes
1 answer

How to call a certain function when click on a Tab in Java?

In a panel i have 3 Tabs (using JTabbedPane). The user can do whatever he wants in Tab1 or Tab2, but when he switches to Tab3 I want him to see the results of what he did in Tab2 or Tab1. How do I do this? I think I have to call a function when the…
Sal-laS
  • 11,016
  • 25
  • 99
  • 169
0
votes
1 answer

When JtextField get filled, JTable cell has to be filled. How to do it?

In my frame, I have a JTable and a JTabbedPane. The JTabbedPane contains a JTextField for a Date. When it is filled with a date and Enter or Tab key is pressed, the "Date" column of the JTable has to be filled. I have a method to check whether the…
Praful
  • 43
  • 2
  • 6
0
votes
1 answer

JTabbedPane - ArrayIndexOutOfBoundsException

Im adding and removing tabs in JTabbedPane dynamically. Code: //Method which adds new tab private void addTab(String title, MainPanel panel) { tabbed.addTab(title, panel); int index = tabbed.indexOfComponent(panel); …
user2102972
  • 251
  • 2
  • 6
  • 13