JComponent () { JTabbedPane tabbedPane = new JTabbedPane(TOP, JTabbedPane.SCROLL_TAB_LAYOUT) { @Override public Dimension getPreferredSize() { return new JBDimension(600, 400); } }; { for (int i = 1; i < 22; i++) { JLabel label = new JLabel("Label #" + i, SwingConstants.CENTER); label.setBorder(JBUI.Borders.customLine(new Color(255, 255, 255, 128), 3)); Icon icon = (i == 19) ? AllIcons.FileTypes.Any_type : null; tabbedPane.addTab("Tab #" + i, icon, label); } } return tabbedPane; }