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);
s.getViewport().add(m_tree); getContentPane().add(s, BorderLayout.CENTER); setVisible(true); UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); } catch (Exception evt) {} new FileTreeViewer();
public static void main(String[] args) { try { UIManager.setLookAndFeel("ch.randelshofer.quaqua.QuaquaLookAndFeel"); } catch (Exception ex) { ex.printStackTrace(); } JFrame f = new JFrame("Drawing Settings2"); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.add(new EditCanvasPanel()); f.pack(); f.setVisible(true); }
public static void show(Window window) throws Exception { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); window.pack(); window.setVisible(true); }
final JFrame frame = new JFrame("Nested Layout Example"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); plafComponents.add(plafChooser); plafComponents.add(pack); int index = plafChooser.getSelectedIndex(); try { UIManager.setLookAndFeel( plafInfos[index].getClassName() ); SwingUtilities.updateComponentTreeUI(frame); if (pack.isSelected()) { frame.pack(); frame.setMinimumSize(frame.getSize()); gui.add(plafComponents, BorderLayout.NORTH); frame.pack(); 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 show(Window window) throws Exception { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); window.pack(); window.setVisible(true); }
for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { UIManager.setLookAndFeel(info.getClassName()); break; frame = new JFrame(); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.getContentPane().add(splitPane, BorderLayout.CENTER);
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); frame.getContentPane().add(mainPanel, BorderLayout.CENTER); frame.pack();
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 (Exception e) { e.printStackTrace(); getContentPane().add(fields, BorderLayout.NORTH); getContentPane().add(scrollPane, BorderLayout.CENTER); getContentPane().add(buttons, BorderLayout.SOUTH);
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);
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);
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);
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);
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();
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();
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);
public void run() { try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (ClassNotFoundException | InstantiationException | IllegalAccessException | UnsupportedLookAndFeelException ex) { label.setFont(font); JFrame frame = new JFrame("Testing"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setLayout(new GridBagLayout()); frame.add(label); frame.pack(); frame.setLocationRelativeTo(null); frame.setVisible(true); } catch (IOException | FontFormatException exp) { exp.printStackTrace();