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

display multiple image in tabbedpane

could any one suggest me the way to show multiple images in tab of jtabbedpane for example i would like to show thumbnail view of images and on selecting the image it should open in a other tab? i have put part my code to show what i want. here i…
Jony
  • 1,035
  • 7
  • 17
  • 43
1
vote
1 answer

Jtabbedpane how to set one tab enable to false

I have an application using JtabbedPane. Each tab is a JPanel. I wrote a function that should set certain tabs enabled to false in certain cases. Here is the code but I don't know why it doesn't work. public boolean DBEnabledTabs(int zakladki) { …
Bulit
  • 975
  • 6
  • 15
  • 26
1
vote
0 answers

JTabbedPane connected to a JLayeredPane with 2 JPanels in it?

I am writing an application in Java and I am running into issues with a JTabbedPane filled with a JLayeredPane that contains 2 JPanels. I need to have two different pages (profile and edit profile) so that the Profile Tab shows the profile and the…
jbeverid
  • 291
  • 7
  • 23
1
vote
1 answer

JTabbedPane: change tab size when change tab title

I have a a JTabbedPane myTab within my JFrame. Its first tab has a title of "old title". I want to change the title dynamically, so I use this code to set: myTab.setTitleAt(myTab.getSelectedIndex(), "my full new title"); And somehow my new title is…
baizen
  • 304
  • 6
  • 14
1
vote
1 answer

Why does the JTextArea disappear when I switch tabs?

Why does the JTextArea disappear when I switch tabs? I'm running Ubuntu linux, if that makes a difference at all. import java.awt.BorderLayout; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.GridBagConstraints; import…
carboncomputed
  • 1,630
  • 3
  • 20
  • 42
1
vote
1 answer

Setting Dimensions Of JPanel on JTabbedPane in JInternalFrame in Java

Users of my software need to be able to click on different tabs to see different types of data representations. However, the code I am including below does not show the requested data panel when the user clicks on a tab. You can re-create the…
CodeMed
  • 9,527
  • 70
  • 212
  • 364
1
vote
1 answer

Java - Right Clicking JTabbledPane Tab

I have it working, however the popup menu appears when you right click anywhere inside the tab. I only would like it to appear when you right click the top of the tab (the name). I cannot figure out how to do this. Any help is appreciated. Thanks.
Stripies
  • 1,267
  • 5
  • 19
  • 29
1
vote
1 answer

Displaying JPanels plus its components in a tab within a JFrame using each tab as a seperate class

Please I need some help. I am trying to create a JFrame to contain Tabs, and each tab will show one panel. Each panel contains buttons and Textfields. The panels are should show a separate class on each tab but the panels show without the buttons…
Iyemwen
  • 11
  • 1
  • 1
  • 5
1
vote
1 answer

Change focus via KeyListener when switch between tabs in JTabbedPane

What I planned to do is when I press Enter key, the application will fire up the button btn_teach, and switch to another tab with textfield focused. Now, when I implement it, it works perfectly if I press the button manually (not pressing Enter).…
user385261
  • 4,069
  • 8
  • 26
  • 24
1
vote
2 answers

JTabbedPane Scroll Button Position

Been working with JTabbedPane and trying to customize it when using SCROLL_TAB_LAYOUT specifically with the scroll direction buttons. I'm extending BasicTabbedPaneUI, but I don't see a method or ability to change the location of the scroll buttons.…
Neil
  • 11
  • 1
1
vote
1 answer

Swing issue, drawing on a JTabbedPane

i'm having hard time trying to understand and solve a problem while drawing on a JPanel within a JTabbedPane Basically i have this small app that draws stats graphics, its a simple JFrame with a JTabbedPane in it. Now, the JTabbedPane has 2 tabs,…
JBoy
  • 5,398
  • 13
  • 61
  • 101
1
vote
1 answer

Open another existing panel when user click button

I have created a java application which has a JTabbedPane that contains three JPanels. In my first panel I have a button. When the user clicks the button, it should open/show the second panel. Can anyone tell me how I can do that?
Sas
  • 2,473
  • 6
  • 30
  • 47
1
vote
3 answers

When JPanel changes, elements of the old JPanel are left behind

I'm using a JTabbedPane, and on each tab there's a panel, which changes when the user does things like click buttons. The problem I'm getting is that elements from the previous panel get left behind. Usually you can't see them until you run the…
user1002973
  • 2,088
  • 6
  • 22
  • 31
1
vote
1 answer

JTabbedPane mouseover paint issue

I am working with an application that is experiencing painting issues on some users computers when the mouse passes over the tabs in a JTabbedPane. They also occasionally have similar issues on other interactive components like JButtons. I have…
shinds
  • 756
  • 7
  • 13
1
vote
1 answer

JTabbedPane imbedded in JTabbedPane pushing bounds with too many tabs

I am trying to code a checklist style program and am using a JTabbedPane inside another JTabbedPane. Everything was fine until I tried adding another set of tabs under one tab. Then the bounds of the overall JTabbedPane started increasing and going…