/** * Shows a {@code JFrame} containing the specified {@code component} and * frame extended {@code state}. * * @param component the {@code Component} to show * @param state the extended state of the frame */ public static final void showComponent(Component component, int state) { showComponent(component, "", state); }
public static void main(String[] args) { setNimbusLookAndFeel(); showComponent(createButton(), "JButtonBuilder demo"); }
public static void main(String[] args) { ColorLegend colorLegend = new ColorLegend(getColors(), VERTICAL); showComponent( createPanelAndCenterComponent(colorLegend), "ColorLegend demo" ); }
public static void main(String[] args) { showDialog( new ItemSelectionDialog<>(new JFrame(), asList("A", "B", "C"), 2) ); } }
/** * Sets the value of the property {@code Nimbus.keepAlternateRowColor} in * {@code UIManager} to {@code true}. * */ public static void setNimbusKeepAlternateRowColor() { setNimbusKeepAlternateRowColor(Boolean.TRUE); }
@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) { Wizard dialog = new Wizard(new JFrame(), "Demo Wizard", getWizardSteps()) { private static final long serialVersionUID = 1L; @Override protected void wizardFinished() { System.err.println("Wizard finished!"); super.wizardFinished(); } }; showDialog(dialog); }
/** * Shows a {@code JFrame} containing the specified {@code component}. * * @param component the {@code Component} to show */ public static final void showComponent(Component component) { showComponent(component, ""); }
public static void main(String[] args) { setNimbusLookAndFeel(); showComponent(new JScrollPane(getDemoTable())); }
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) throws InvalidClassException { ListSelectionDialog<String> dialog = new ListSelectionDialog<>( new JFrame(), emptyList(), asList(new String[] { "a", "b", "c", "d" })); showDialog(dialog); } }
public static void main(String[] args) { showComponent( createJOptionPaneMessageDemooComponent(), "JOptionPaneMessage demo"); }
public static void main(String[] args) { setNimbusLookAndFeel(); showComponent(new JScrollPane(getDemoTable())); }
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) { showDialog(new ColorsSelectionDialog(new JFrame(), 1, 2, COLORS)); } }
public static void main(String[] args) { JFileChooserPanel fileChooserPanel = new JFileChooserPanel(SAVE, "csv"); /** * Uncomment the following line to hide the label. */ /* * fileChooserPanel.getComponentLabelFile().setVisible(false); */ showComponent(fileChooserPanel, "JFileChooserPanel demo"); } }
public static void main(String[] args) throws IOException { downloadTestData(); setNimbusLookAndFeel(); try { // First, the GenomeIndex object required by the GenomeBrowser to // work is created. GenomeIndex genomeIndex = new PileLineGenomeIndex( PILELINE_INDEX_FILE); // Then, the GenomeBrowser is instantiated and visualized. Note that // it only requires a GenomeIndex to be created. GenomeBrowser genomeBrowser = new GenomeBrowser(genomeIndex); showComponent(genomeBrowser); // At this moment the GenomeBrowser is being shown and a new // sequence (chromosome) and positions range are set. Note that they // can also be established manually by the user trough the component // controls. genomeBrowser.setSequence("22"); genomeBrowser.seekPositions(14880570, 18748443); // Finally, two files are programmatically added as tracks to the // GenomeBrowser. Again, note that they can be added by the user // through the component controls. sleep(1000); genomeBrowser.addTrack(BED_FILE); sleep(1000); genomeBrowser.addTrack(BAM_FILE); } catch (InterruptedException e) { e.printStackTrace(); } }
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"); } }
public static void main(String[] args) { showDialog(new FontConfigurationDialog(new JFrame())); } }
public static void main(String[] args) { java.util.Locale.setDefault(java.util.Locale.ENGLISH); CsvTable table = new CsvTable(dataValues, columnNames); showComponent(new JScrollPane(table), "CsvTable demo"); } }