Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><a href="http://sscce.org/" rel="nofollow noreferrer">sscce</a> for potential answerer(s) for Nimbus L&amp;f (by using another L&amp;f isn't possible to reproduce this funny issue), in case that Containers#Size packed Tabs to the two or more <code>Lines</code>, <img src="https://i.stack.imgur.com/X1bpW.jpg" alt="enter image description here"><img src="https://i.stack.imgur.com/bSSky.jpg" alt="enter image description here"></p> <p>as I know there is only one <a href="http://code.google.com/p/aephyr/source/browse/trunk/src/?r=46#src/aephyr/swing/tabfolder" rel="nofollow noreferrer">possible solutions</a> (without override NimbusTabbedPaneUI) by <a href="http://code.google.com/p/aephyr/" rel="nofollow noreferrer">aephyr</a></p> <p>from sscce</p> <pre><code>import java.awt.BorderLayout; import javax.swing.*; public class TabbedPane { private static final long serialVersionUID = 1L; public TabbedPane() { JPanel jp = new JPanel(); jp.setLayout(new BorderLayout()); JTabbedPane tb = new JTabbedPane(); //tb.setUI(new CustomTabbedPaneUI()); tb.add("Tab1", new JTextArea(10, 20)); tb.add("Tab2", new JTextArea(10, 20)); tb.add("Tab3", new JTextArea(10, 20)); tb.add("Tab4", new JTextArea(10, 20)); tb.add("Tab5", new JTextArea(10, 20)); jp.add(tb, BorderLayout.CENTER); //add(jp, BorderLayout.CENTER); //tb.setEnabledAt(1, false); //tb.setEnabledAt(3, false); JFrame frame = new JFrame(); frame.setLayout(new BorderLayout()); frame.add(jp, BorderLayout.CENTER); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.pack(); frame.setVisible(true); } public static void main(String[] args) { try { for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (Exception system) { system.printStackTrace(); } SwingUtilities.invokeLater(new Runnable() { @Override public void run() { TabbedPane tP = new TabbedPane(); } }); } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload