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

how can I put a class in JTabbedPane?

tabbedPane = new JTabbedPane(); tabbedPane.addTab( "Page 1", class1); tabbedPane.addTab( "Page 2", class2); tabbedPane.addTab( "Page 3", class3); topPanel.add( tabbedPane, BorderLayout.CENTER ); can i put 3 classes here? How?
-1
votes
1 answer

Java jTabPanel, handle with specific tab

I create a jTabPanl with 3 tab: add, update, remove for example. It can be if I click on each tab, it show index tab such as: click on Add tab, it do System.out.println("clicking tab 0") click on Update tab, it do System.out.println("clicking tab…
haind
  • 1,000
  • 2
  • 16
  • 28
-1
votes
1 answer

JTabbedPane Forced Size

I have a JFrame that has 3 components on it. The design is like this: My problem happens in the JTabbedPane. The pane begins off with a settings panel, which is added to it when the whole JFrame loads up. Then, when the user connects, a new tab is…
Tyluur
  • 95
  • 2
  • 10
-1
votes
1 answer

Java JTabbedPane - removing gap at the end of JTabbedPane row

I was looking for answer for a while and i simply cannot find it. Any knows how can i remove the gap that is in the end of line of tabs in JTabbedPane? When I add many different tabs so there are like 3 lines and every got such gap in the end as it…
Jackie
  • 5
  • 6
-1
votes
1 answer

Accessing the local variable of other class from one class

1st Class : jb4=new JButton("Select the File"); jb4.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent ae) { final JFrame JF=new JFrame("Video Player"); JFileChooser fc=new JFileChooser(); …
-1
votes
2 answers

How Can I Clone a tab in a JTabbedPane?

I'm looking for a way to clone (duplicate) a whole tab (the selected one) in a JTabbedPane. Every time I take the tabwith getSelectedComponent() and add it to the pane, the title of the tab disapnö rs and I get no second tab. But there is no…
-1
votes
1 answer

JMenu work on single tab

I have a JMenuBar and I have a JTabbedPane, when I create multiple tabs the JMenuBar does it on all the tabs, e.g. I open a file it opens the same file in each tab. However I only want it to open a file on the current tab. I have added a…
user1938460
  • 75
  • 1
  • 1
  • 9
-1
votes
1 answer

Adding Icon JLabel icon to the JTabbed Pane side

I am trying to insert an icon via JLabel to the left side of my Jtabbed pane bar..but problem is what ever i insert at the left of my widnow it makes it a new tabe pane..How to insert icon showing in image..?
Haseeb Wali
  • 1,181
  • 3
  • 14
  • 34
-1
votes
1 answer

Adding text to jTextarea in jTabbedPane

I have a desktop program with 3 tabs i'm building in netbeans. There is 1 text input field below the three tabs. each tab has a jtextarea component. When i type in the text input field and hit enter i want it to add that text to the textarea…
stihl
  • 241
  • 2
  • 6
  • 16
-2
votes
3 answers

How can I call a method on a parent panel from an action listener

I had a problem and found a solution, but I can't understand why this following code is not working. What I want to do is, that the tab is switching when a button gets pressed in the "Administration.class". I got a JTabbedPane which is added in the…
Simon Pio.
  • 115
  • 1
  • 14
-2
votes
1 answer

how to add multiple tab support feature in my notepad application using java?

I made a notepad application using java swing and currently it has the following features in it, you can create a new file and save it to the desired location also you can open an existing file, edit it and save it on a new location or update the…
nrj
  • 1
  • 3
-2
votes
2 answers

Adding Jtable to Tab in java

I am developing an java gui. It has TabedPane. I have added panel to tab. How to add jtable to panel which is in tab2;
-3
votes
2 answers

Adding tabs after pressing a button in java

I am using java swing and I want to add 3 tabs after the user is choosing "New" from JMenuBar. The tabs won't be there when the application is started. These will be shown only after choosing "New". How can I Do it? Do I need to add these to the…
D.L.
  • 169
  • 3
  • 17
-4
votes
1 answer

I got "error:cannot find symbol" for the JButton inside a frame outside of a JTabbedPane

So I have a frame, inside the frame there are tabs. I tried to put Jbutton outside of the tab but it wouldn't recognize my Jbutton. I keep on getting error: Cant find symbol. I don't understand why that happened. Would someone explain? import…
1 2 3
54
55