Reputation: 2545
Hi guys i writing an app that have JTabbedPane in it. but the problem is it's always have tab header on it.
i want to remove that tab header and make JTabbedPane look like an rectangle one.
Here my code:
public final static JTabbedPane getTabbedPane()
{
JTabbedPane jtp=new JTabbedPane();
jtp.add(new JLabel("Tab"));
jtp.add(new JLabel("Tab"));
jtp.add(new JLabel("Tab"));
jtp.add(new JLabel("Tab"));
return jtp;
}
Upvotes: 2
Views: 843
Reputation: 9
Yes, Here is an clean example, it works for me :
JPanel panelOutils = new JPanel();
panelOutils.add(ongletOutils);
JScrollPane scrollOutils = new JScrollPane(panelOutils,JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
JTabbedPane jTabbedPaneOutils = new JTabbedPane();
// With Tab header
jTabbedPaneOutils.add(scrollOutils);
this.addTab("Outils", jTabbedPaneOutils);
// Delete tab header
this.addTab("Outils", jTabbedPaneOutils.add(scrollOutils));
Upvotes: -1
Reputation: 109823
i want to remove that tab header and make JTabbedPane look like an rectangle one.
no idea whats your goal
use CardLayout
set LineBorder
for JLabel
Upvotes: 5