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

writting a button that creates a tab, i need to pass some information to the new tab?

I am writing a program with JTabbed Panes. I want to have a button that gets some text from a JTextField, uses that text to create a new tab. The new tab will contain the name = Jtextfield.getText(), and it will print it in a JTextArea 10 times. My…
Don Code
  • 781
  • 3
  • 12
  • 25
0
votes
2 answers

JTabbedPane with button getting the pane

I have a JTappedPane with a button on that I want to make close that tab. I am doing it like so: jTabbedPane1.addTab(title, null, panel, null); JPanel pnl = new JPanel(); JButton close = new JButton(); try { Image img =…
Sagarmichael
  • 1,624
  • 7
  • 24
  • 53
0
votes
2 answers

Best way to undoc/doc tabs JTabbedPane Java

As the title suggests whats the best way to doc/undoc a tab from a JTabbedPane? Similar to how you can drag a tab in Chrome and it will open a new window, then dragging it back will place it back again?
user1724416
  • 914
  • 2
  • 11
  • 24
0
votes
2 answers

How can I put 3 separate programs into a JTabbedPane. They are already written for a JFrame

So for the sake of keeping it simple, lets say I want to have 3 separate programs all display in a JTabbedPane. Suppose they are all Hello World simple file in a JFrame. Lets use this simple file and create HelloWorld1.java, HelloWorld2.java and…
Marc S.
  • 5
  • 3
0
votes
1 answer

redraw jlabel in loop defined jpanels and decleration of jpanels in loop

So for fun I've been working on developing this simple stock-chart GUI, which grabs charts from YahooFinance and displays them into a tabbed-Jpanel. I've been able to get the tabs to populate with user-defined stocks and all. However, I've developed…
A.G.
  • 153
  • 1
  • 4
  • 12
0
votes
1 answer

Automatic resizing (JTextArea and JTabbedPane) instead of fixed layout

I make my first baby steps in Java and Swing GUI. My plan is to make a little GUI with an JTextArea to fill in some text and two tabbed JPanels. But the problem is, when I fill in some text in the JTextArea and click the tab "Includes" (or the other…
swaechter
  • 1,357
  • 3
  • 22
  • 46
0
votes
2 answers

Why won't this Swing tabbed pane display?

Could someone explain what I am doing wrong with my classes that my JTabbedPane doesn't display when the JFrame.setvisible is set to true? Yes, the main method of the program (which I won't put here) uses the event dispatching thread to initiate…
elwynn
  • 237
  • 2
  • 5
  • 14
0
votes
2 answers

How to share information in Java between tabs in JTabbedPane

I have one tab that displays the list of users in a JTable that I have extracted from a database and another tab that displays JTextFields that want to edit the user details then save them to the database. One of the unique feature of a user is a…
Francis
  • 603
  • 1
  • 6
  • 17
0
votes
1 answer

JTabbedPane issue: how to find and track existing JTabbedPane's tab

I have an open source application that use JTabbedPane to show its contents. Look at this screenshot: The main content has a JSplitPane where at the left side is TreeMenu object and at right side is JTabbedPane object. When I clicked a menu from…
null
  • 8,669
  • 16
  • 68
  • 98
0
votes
1 answer

The tab added in JTabbedPane doesn't show up

I have VTreePanel class that extends from CPanel which extends from JPanel. The class has a JSplitPane object that is divided into two area: left & right. The left side contains tree menu selection object. At right side, it contains JTabbedPane…
null
  • 8,669
  • 16
  • 68
  • 98
0
votes
3 answers

Add Video Frame to JTabbed pane

I have created a java tabbed pane. In the tabbed pane i have created a tab called Video. I want whenever i click on the video tab a video should automatically be played on the tab panel itself. Can I do this? If yes please tell me how to do it.
user1673627
  • 271
  • 3
  • 6
  • 13
0
votes
1 answer

JTabbedPane adding null components

Riddle me this: I have a JTabbedPane that has custom JPanels in it. When I try and access those JPanels, all I get back is null. I know that the panels have been added because on the UI I can see the tabs. I can also interact with the panels and…
Robbie
  • 831
  • 2
  • 14
  • 22
0
votes
2 answers

A button at the end of all tabs to close the window

I have a requirement to put the minimize and close button at the right corner where my JTabbedPane ends. For clarity, the encircled area are the two button which I require (I have an undecorated frame) Can anyone please guide me on how to achieve…
user1639485
  • 808
  • 3
  • 14
  • 26
0
votes
1 answer

keep input of different textfields in different tabs in a jtabbedpanel-java

I have a JTabbedPane which contains 3tabs and there are 2 textfields in each tab panel. User enters input/text in textfields of tab1, then goes to tab2 and enters input for textfields of that tab and ... Is there any way to keep all this data and…
SunnY
  • 59
  • 1
  • 4
  • 11
0
votes
3 answers

Set JTabbedPane width to constant

I'm implementing an UI in Java Swing. Therefore I use a JTabbedPane. The tabbedPane has no components at startup. When i add a tab to the tabbedpane, the width of the tabbedpane increases, when i remove the tab, the width resizes to the width at the…
msp
  • 153
  • 1
  • 8