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
-1
votes
1 answer

Nested JTabbedPane contents not rendering as expected

I am building a Java Swing application, and am trying to use nested JTabbedPane components in it, and am having mixed results. In my top-level JFrame, I am able to successfully construct and load tabbed panes with JPanels. In the top level of the…
-1
votes
2 answers

Table in scrollPane in JTabbedPane

I want to use JTabbedPane to display some tables (one table in each Tab). Pretty easy to realise: you make a JTabbedPane, put some scrollPanes (which represents the tabs) then you just add the table to your scrollPanes. My problem is that in…
Marius
  • 13
  • 4
-1
votes
1 answer

Choice appears over JMenu

I'm creating a program interface where the users selects something into a menu and then it will display several tabs. Inside some tabs there are choices. The problem comes when the user select something from the menu, the tab becomes visible, and…
-1
votes
1 answer

I'm getting Nullpointer exception for JTabbed pane index after execution

I am getting an error when im trying to write a code to automatically select a tab from tabbed pane when condition is true, but im getting an error with null pointer exception in while im trying to execute the code after compiling it!! The problem…
-1
votes
1 answer

How to add a JMenuBar to a JTabbedPane?

I need to create a JMenuBar that will be shown under of JTabbedPane named as shapes. When I changed tab, menu bar will not be shown in the other tab. You can see what I mean from images. I created a menu bar and add it to JFrame but that is not I…
-1
votes
1 answer

How do I refresh a JTabbedPane tab when the item tab has been clicked?

I'm currently working on a Java application that uses JTabbedPane. I would like to refresh a tab in JTabbedPane, but when I click on the "tab" item the tab does not refresh. What could be the problem? public class MainClass extends …
Amine Soumiaa
  • 683
  • 5
  • 13
-1
votes
1 answer

Change jTabbedPane alignment

I spend hours in searching about changing jTabbedPane alignment from left to right as following: screen shot: right alignment screen shot: left alignment
-1
votes
2 answers

Create a Method to add components in Selected JTabbedPane

I am a newbie, and I have already passed some days to get the idea, but could not solve it, if anyone can help me. I have main two JPanel in one JFrame. I have some buttons in the first panel. I have One method to add a panel to theJTabbedPane by…
-1
votes
2 answers

How to Push/call the getSelectedIndex value from StateChanged method to another method/class?

I want to push/call the selected tab index value from the StateChanged method to another class or private method, How can I do this, private class TabSelect implements ChangeListener { @Override public void stateChanged(ChangeEvent e)…
-1
votes
1 answer

Switch the tab of a tJabbedpane on a click of button in different class?

in A class when i click a button and that button returns the true or false . if true returned then Next Tab of JTabbedPane is enabled ,which is written in another class. It may Sound stupid but I've tried a lot. and it is continously giving Null…
Napster
  • 1
  • 4
-1
votes
1 answer

JTabbedPane, data inside the JTable's

I have a problem with data, inside the cell in selected tab what contains JTable where i want to do calculations. I made 3 tabs with 3 tables, each cell of my table have integers for tests. I want to select tab with index=1 then try to make easy…
-1
votes
1 answer

how to align multiple jpanels under each other

in the below code i am trying to create tabs. 1-according to the code below, the jlabel the contains the word "Demo", at run time, it does not show up! why that is happening and how to force that jlabel to appear? 2-as you see in the code, the…
Amrmsmb
  • 1
  • 27
  • 104
  • 226
-1
votes
1 answer

Removing all tabs in a jtabbedpane except index 0

I have a "starter tab" at index 0 of my tabbed pane. The user can create a multitude of tabs and remove them as needed. They can also remove all. However, this removes index 0 as well. What does the function look like that removes all tabs except…
KiloJKilo
  • 465
  • 1
  • 6
  • 16
-1
votes
1 answer

How To Change The Tab Name in JTabbedPane

I want to change the Name of the tab After save an created Document and when I create a New Document the cursor is not placing/focus in TextArea,when I click on textarea then only it focus.How can I achive Auto focus on Textarea.In My Application…
user3912886
  • 53
  • 2
  • 9
-1
votes
1 answer

How can I pass an ArrayList between two separate JTabbedPanes

I have a program utilizing JTabbedPane. On one pane I have a button that updates an arrayList of objects based on input from the same pane. What I would like to happen is have the second pane update itself with the object information based on the…
jrounsav
  • 517
  • 2
  • 6
  • 20
1 2 3
54
55