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

How to deny choose same file with JFileChooser

I am creating program whose function is that reading "n" .txt or .java files and of these files creates a UML diagram. I have reading method, but I came to problem with load more same files. I would like to deny load same files, because it makes…
avalagne
  • 359
  • 3
  • 7
  • 15
-1
votes
1 answer

Implement undo/redo for tabbed JEditorPanes

I'm developing a basic editor within my application, which allows to view several components within a JTabbedPane. Each tab holds a JScrollPane which contains a JEditorPane. Now I would like to implement an undo and redo functionality. So if I…
Phidelux
  • 2,043
  • 1
  • 32
  • 50
-1
votes
2 answers

Java JTable function for loading an Object

I have a jtable in an java application and it reads an object[x][y] when created (with the jtablejTable3.setModel() function).Is there any function when objects data be changed to load them in my java table
user973493
  • 39
  • 1
  • 5
-1
votes
2 answers

My code is not working. How should I add a JScrollPane on a JTextArea that is in a JTabbedPane?

this is the code I have so far public class WindowHelpGui extends JFrame{ JScrollPane scroll; //constructor public WindowHelpGui(){ //add window title super("Help"); //set window layout setLayout(null); …
qtdumdum
  • 1
  • 2
-1
votes
1 answer

How do I create a JButton solely on one pane that prints "Hello

Every time I try to do this, it gives me an error that "Change Listener cannot be converted to Action Listener" and even if I implement ActionListener to the class... it still gives me another error Is there a way to create a JButton only on the…
-1
votes
1 answer

JTextFieldUI painted in another tab of the JTabbedPane with my personal look and feel

I'm developing a new look and feel and now I have a bug with the component JtextField when to use it inside the JTabbledPane component. So the bug is this I have this code for my JTextFieldUI, it extends BasicLookAndFell public class…
vincenzopalazzo
  • 1,487
  • 2
  • 7
  • 35
-1
votes
2 answers

how to display the contents of a tab in the workspace of Jtabbedpane?

i'v put a jpanel on the tab of Jtabbedpane which is at the left side ,nw when the tab is clicked i want to display labels and textfields in the workspace of the tabbedpane,plz hlp.
Sia
  • 25
  • 1
  • 6
-1
votes
1 answer

When i increase my GUI window size to full the components go back to standard layout

When i increase the window size to full, my components goes back to standard layout(jtable,button1,button2,button3) and so on. so i wonder if my code is right and how i can decrease the window size. JTabbedPane jtabbed = new…
-1
votes
1 answer

Adding components to JTabbedPane

When I run the code , none of the components, neither the JTable or the buttons will show up inside the tab, they appear on the side of the tab window instead. any reason why that is ? public void GUIcode() { setLayout(new GridBagLayout()); …
-1
votes
1 answer

JTabbedPane change listener to read from file

I have a JTabbedPane containing 7 tabs each tab contains a class extending JPanel, what I need is if I change in any tab and save to a file, the changes made could be used in the other tabs without closing the program and running it again I added…
-1
votes
1 answer

JLabel like a tab

I´m trying to use a JLabel as a tab for a JTabbedPane, but I don't know how to do it. Is it possible? If not, what I'm trying is to do tabs that look like these: Win10Tabs:
Yulo Vallejos
  • 17
  • 1
  • 8
-1
votes
1 answer

Get the in-focus tab after closing a tab

In a JTabbedPane, I associated a custom-made Data object to each added tab. I also have a corresponding Metadata object that shows up in another panel when the tab is selected. The problem I have now is when a tab is closed, the metadata panel shows…
-1
votes
1 answer

JAVA Can we overlap objects between NORTH and SOUTH in JPanel with BorderLayout?

I have JTabbedPane, one of its tabs contain JPanel with BorderLayout (one JPanel in NORTH for menu-like itmes, quite narrow height of cca. 50px + one JPanel that contians JScrollPane in SOUTH for the content which is quite tall). When I click on one…
theoneiam
  • 11
  • 6
-1
votes
1 answer

Java Swing addTab with count

Some swing components i have: //JList DefaultListModel listModel = new DefaultListModel(); JList list = new JList(listModel); //JTabbedPane JTabbedPane tabbedPane = new JTabbedPane(); frame.add(tabbedPane); //JSplitPane…
bababa
  • 29
  • 2
-1
votes
1 answer

Java tab's contents keep moving

This code's purpose [Open Java file, than content of that Java file will display at new Tab] I also try to make compile func but I need to solve this problem at here first. My problem is when I try to open new Java file, then last content of Java…
Taker829
  • 1
  • 1