I'm working with JTabbedPane, and I want to add to the tabs a close button.
I created a JButton, with one: ActionListener, for when you click, this removes the tabs is open one by one.
Also, I create a JTabbedPane...
//Tabbed.
JTabbedPane Tabbedr = new JTabbedPane();
File F = new File("HTML1.html");
Frame.getContentPane().add(Tabbedr);
Tabbedr.addTab(F.getName());
//Button.
JButton Close = new JButton();
Close.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent a){
Tabbedr.remove(1);}});
So, here all its fine, but I dont know how to add the JButton "Close", to my tabs. As in some famous editors,
To test the button I added this to a one toolbar, but I want to put this inside to the tabs. Example: Hello,txt "X".
¿Someone can help me? Thank you for read and your time.