JFrame f = new JFrame("Frame " + ii); f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); String s = "os.name: " + System.getProperty("os.name") + "\nos.version: " + System.getProperty("os.version"); f.add(new JTextArea(s,3,28)); // suggest a size f.pack(); f.setVisible(true); public void run() { try { UIManager.setLookAndFeel( UIManager.getSystemLookAndFeelClassName()); } catch (Exception useDefault) {} initGui();
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception e) { logger.warning("Could not set native look and feel."); this.getContentPane().add(mainPanel);
EventQueue.invokeLater(new Runnable() { @Override public void run() { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) {
public JFrame newFrame(JPanel panel) { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception e) { // ignore failure to set default look en feel; } JFrame frame = new JFrame(); frame.add(panel); frame.pack(); frame.setVisible(true); return frame; }
public static void show(Window window) throws Exception { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); window.pack(); window.setVisible(true); }
EventQueue.invokeLater(new Runnable() { @Override public void run() { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) { JFrame frame = new JFrame("Testing"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setLayout(new BorderLayout()); frame.add(new TestPane()); frame.pack(); frame.setLocationRelativeTo(null); frame.setVisible(true);
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (ClassNotFoundException | InstantiationException | UnsupportedLookAndFeelException | IllegalAccessException e) { LOGGER.error("[!] Exception setting system theme:", e); gbc.gridy = 0; pane.add(ripPanel, gbc); gbc.gridy = 1; pane.add(statusPanel, gbc); gbc.gridy = 2; pane.add(progressPanel, gbc); gbc.gridy = 3; pane.add(optionsPanel, gbc); gbc.weighty = 1;
public static void main(String[] args) throws Exception { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); java.awt.EventQueue.invokeLater(new Runnable() { @Override public void run() { DGenerateKeyPair dialog = new DGenerateKeyPair(new JFrame(), KeyStoreType.JKS, KeyPairType.RSA, 1024); dialog.addWindowListener(new java.awt.event.WindowAdapter() { @Override public void windowClosed(java.awt.event.WindowEvent e) { System.exit(0); } }); dialog.setVisible(true); } }); } }
public static void show(Window window) throws Exception { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); window.pack(); window.setVisible(true); }
EventQueue.invokeLater(new Runnable() { @Override public void run() { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) { JFrame window = new JFrame(); window.setSize(840, 560); window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); window.add(grid); window.setVisible(true); grid.fillCell(0, 0); grid.fillCell(79, 0);
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); frame.getContentPane().add(mainPanel, BorderLayout.CENTER); frame.pack();
public static void main(String[] args) throws Exception { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); final KeyPair keyPair = KeyPairUtil.generateKeyPair(KeyPairType.RSA, 1024, new BouncyCastleProvider()); java.awt.EventQueue.invokeLater(new Runnable() { @Override public void run() { DAddExtensions dialog = new DAddExtensions(new JFrame(), "Add Extensions", new X509ExtensionSet(), keyPair.getPublic(), new X500Name("cn=test"), BigInteger.ONE, keyPair.getPublic()); dialog.addWindowListener(new java.awt.event.WindowAdapter() { @Override public void windowClosed(java.awt.event.WindowEvent e) { System.exit(0); } }); dialog.setVisible(true); } }); } }
EventQueue.invokeLater(new Runnable() { @Override public void run() { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) { JFrame frame = new JFrame("Testing"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setLayout(new BorderLayout()); frame.add(new TestPane()); frame.pack(); frame.setLocationRelativeTo(null); frame.setVisible(true); add(cellPane, gbc);
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception e) { e.printStackTrace(); getContentPane().add(fields, BorderLayout.NORTH); getContentPane().add(scrollPane, BorderLayout.CENTER); getContentPane().add(buttons, BorderLayout.SOUTH);
public void run(String[] args) throws Exception { final Context ctx = new SimpleRunner(new MappedFileSource(args[0])).runWith(this).getContext(); UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); EventQueue.invokeLater(new Runnable() { public void run() { try { MainWindow window = new MainWindow(); window.getClassTree().setModel(new DefaultTreeModel(new TreeConstructor(ctx.getProcessor(DTClasses.class)).construct())); window.getFrame().setVisible(true); } catch (Exception e) { e.printStackTrace(); } } }); }
try{ System.out.println("setting look and feel"); UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); }catch(Exception e){ System.out.println("Unable to set LookAndFeel"); defaultItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { setVisible(true); setExtendedState(JFrame.NORMAL); try { tray.add(trayIcon); setVisible(false); System.out.println("added to SystemTray"); } catch (AWTException ex) { try{ tray.add(trayIcon); setVisible(false); System.out.println("added to SystemTray"); }catch(AWTException ex){ setVisible(true); setSize(300, 200); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
public void run() { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (final Exception e1) { e1.printStackTrace(); l.setOpaque(false); c.add(l, constraints); b.setFocusable(false); c.add(b, constraints);
final JFrame frame = new JFrame("Demo buttons"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); buttonPanel.add(new JButton("Export do SVG")); buttonPanel.add(new JButton("Export do PNG")); buttonPanel.add(new JButton("Tisk...")); frame.add(center); frame.pack(); frame.setVisible(true); UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception e) { e.printStackTrace();
EventQueue.invokeLater(new Runnable() { @Override public void run() { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) { JFrame frame = new JFrame("Testing"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); gbc.gridwidth = GridBagConstraints.REMAINDER; frame.add(new JLabel("Hello world"), gbc); frame.add(new JLabel("I'm on top"), gbc); frame.add(new JButton("Clickity-clackity"), gbc); frame.pack(); frame.setLocationRelativeTo(null); frame.setVisible(true); } catch (IOException exp) { exp.printStackTrace();
EventQueue.invokeLater(new Runnable() { @Override public void run() { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) { JFrame frame = new JFrame("Testing"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setLayout(new BorderLayout()); frame.add(new TestPane()); frame.pack(); frame.setLocationRelativeTo(null); frame.setVisible(true);