Question

Hi guys i writing an app that have JTabbedPane in it. but the problem is it's always have tab header on it.

enter image description here

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;
}
Was it helpful?

Solution

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

OTHER TIPS

Yes, Here is an clean example, it works for me : enter image description here

enter image description here

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)); 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top