@Override public void actionPerformed(ActionEvent e) { String tabName = "Tab " + String.valueOf(tabbedPane.getTabCount() + 1); tabbedPane.addTab(tabName, createPanelAndCenterComponent(new JLabel(tabName))); } });
public static void main(String[] args) { JLabel verticalLabel = new JLabel("A vertical label"); verticalLabel.setUI(new VerticalLabelUI(false)); showComponent( createPanelAndCenterComponent(verticalLabel), "JVerticalLabel demo" ); } }
public static void main(String[] args) { ColorLegend colorLegend = new ColorLegend(getColors(), VERTICAL); showComponent( createPanelAndCenterComponent(colorLegend), "ColorLegend demo" ); }
tabbedPane.setHideTabBarWhenSingleTab(true); tabbedPane.addTab("Tab 1", createPanelAndCenterComponent(new JLabel("Tab 1"))); tabbedPane.setPreferredSize(new Dimension(300,200));
public static void main(String[] args) { String[] items = { "Item 1: this item needs more width to be visible", "Item 2: this item also needs more width to be visible", }; ExtendedJComboBox<String> combobox = new ExtendedJComboBox<String>(items); combobox.setPreferredSize(new Dimension(180, 20)); combobox.setAutoAdjustWidth(true); JPanel demoPanel = createPanelAndCenterComponent(combobox); showComponent(demoPanel, "ExtendedJComboBox demo"); } }
public static void main(String[] args) { List<Bean> beans = asList(new Bean("Row 1", 1), new Bean("Row 2", 2)); JXTable table = new JXTable(new BeanTableModel<Bean>(beans)); showComponent( createPanelAndCenterComponent(new JScrollPane(table)), "BeanTableModel demo"); } }