public static void main (String[] args) { for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { try { UIManager.setLookAndFeel(info.getClassName()); } catch (Throwable ignored) { } break; } } EventQueue.invokeLater(new Runnable() { public void run () { new FlameMain(); } }); }
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); UIManager.getInstalledLookAndFeels(); String[] plafNames = new String[plafInfos.length]; for (int ii=0; ii<plafInfos.length; ii++) { plafNames[ii] = plafInfos[ii].getName(); int index = plafChooser.getSelectedIndex(); try { UIManager.setLookAndFeel( plafInfos[index].getClassName() ); SwingUtilities.updateComponentTreeUI(frame); if (pack.isSelected()) { frame.setVisible(true);
for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { UIManager.setLookAndFeel(info.getClassName()); break; frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
import javax.swing.UIManager.LookAndFeelInfo; import java.awt.EventQueue; import java.awt.BorderLayout; import javax.swing.*; public class Frame1 { private JFrame frame; public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { public void run() { try { for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { UIManager.setLookAndFeel(info.getClassName()); break; } } Frame1 window = new Frame1(); window.frame.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } }); }
//Get Installed look and Feels import javax.swing.UIManager; public class InstalledLookandFeels { public static void main(String args[]) { UIManager.LookAndFeelInfo laf[] = UIManager.getInstalledLookAndFeels(); for (int i = 0, n = laf.length; i < n; i++) { System.out.print("LAF Name: " + laf[i].getName() + "\t"); System.out.println(" LAF Class name: " + laf[i].getClassName()); } System.exit(0); } }
for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { UIManager.setLookAndFeel(info.getClassName()); break; window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); window.setLocationByPlatform(true); window.setVisible(true);
public static void main (String[] args) { for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { try { UIManager.setLookAndFeel(info.getClassName()); } catch (Throwable ignored) { } break; } } EventQueue.invokeLater(new Runnable() { public void run () { new FlameMain(); } }); }
public void run() { JFrame frame = new JFrame("TristateCheckBoxTest"); frame.setLayout(new GridLayout(0, 1, 15, 15)); UIManager.LookAndFeelInfo[] lfs = UIManager.getInstalledLookAndFeels(); for (UIManager.LookAndFeelInfo lf : lfs) { System.out.println("Look&Feel " + lf.getName()); try { UIManager.setLookAndFeel(lf.getClassName()); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new IllegalStateException(e); } frame.add(makePanel()); } frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); frame.pack(); frame.setVisible(true); } });
import javax.swing.UIManager.LookAndFeelInfo; import java.awt.EventQueue; import java.awt.BorderLayout; import javax.swing.*; public class Frame1 { private JFrame frame; public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { public void run() { try { for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { UIManager.setLookAndFeel(info.getClassName()); break; } } Frame1 window = new Frame1(); window.frame.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } }); }
public static String getDefaultLookAndFeelName() { String name = UIManager.getSystemLookAndFeelClassName(); UIManager.LookAndFeelInfo[] info = UIManager.getInstalledLookAndFeels(); for (UIManager.LookAndFeelInfo anInfo : info) { if (anInfo.getClassName().equalsIgnoreCase(name)) return anInfo.getName(); } return name; }
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setBackground(new Color(0xfff0f0f0)); f.setLayout(new GridLayout(0, 1)); f.pack(); f.setLocationRelativeTo(null); f.setVisible(true); UIManager.getInstalledLookAndFeels(); List<String> names = new ArrayList<String>(); for (UIManager.LookAndFeelInfo info : available) { names.add(info.getName()); int index = combo.getSelectedIndex(); try { UIManager.setLookAndFeel( available[index].getClassName()); SwingUtilities.updateComponentTreeUI(parent); } catch (Exception e) {
public static void main (String[] args) { for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { try { UIManager.setLookAndFeel(info.getClassName()); } catch (Throwable ignored) { } break; } } EventQueue.invokeLater(new Runnable() { public void run () { new ParticleEditor(); } }); } }
private static void launchGUI(boolean hasMain) throws Exception { try { for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { UIManager.setLookAndFeel(info.getClassName()); break; } } } catch (Exception e) { // not available? will use default L&F } final boolean forceProbe = Boolean.getBoolean("gumshoe.probe.enabled"); final boolean needProbe = forceProbe || hasMain; final ProbeManager probe = needProbe ? ProbeManager.getInstance() : null; final JFrame frame = new JFrame("Inspector"); if( ! hasMain) { // if this is the only program, click X to exit (otherwise just hide) frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); } frame.getContentPane().add(new GUI(frame, probe, hasMain)); frame.pack(); final Dimension fullScreenSize = Toolkit.getDefaultToolkit().getScreenSize(); final int height = fullScreenSize.height; final int width = fullScreenSize.width; final Dimension unmaximizedSize = new Dimension(DEFAULT_WIDTH_PERCENT*width/100, DEFAULT_HEIGHT_PERCENT*height/100); frame.setSize(unmaximizedSize); frame.setExtendedState(JFrame.MAXIMIZED_BOTH); frame.setVisible(true); }
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { javax.swing.UIManager.setLookAndFeel(info.getClassName()); break; new NewJFrame().setVisible(true);
protected String findClassName(String lafName) { for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if (info.getName().equals(lafName)) { return info.getClassName(); } } return null; }
scrollPane.setRowHeaderView(headerTable); table.setPreferredScrollableViewportSize(table.getPreferredSize()); frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); frame.add(scrollPane); frame.add(new JButton(new AbstractAction("Toggle filter") { frame.pack(); frame.setLocation(150, 150); frame.setVisible(true); for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if (info.getName().equals("Nimbus")) { UIManager.setLookAndFeel(info.getClassName()); break;
public static void main (String[] args) { for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { try { UIManager.setLookAndFeel(info.getClassName()); } catch (Throwable ignored) { } break; } } EventQueue.invokeLater(new Runnable() { public void run () { new PreAlpha(); } }); } }
public static String getLookAndFeelName(String className) { UIManager.LookAndFeelInfo[] info = UIManager.getInstalledLookAndFeels(); for (UIManager.LookAndFeelInfo anInfo : info) { if (anInfo.getClassName().equalsIgnoreCase(className)) return anInfo.getName(); } return null; }
frame.setLayout(new BorderLayout()); frame.add(jp, BorderLayout.CENTER); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.pack(); frame.setVisible(true); for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { UIManager.setLookAndFeel(info.getClassName()); break;
public static void main (String[] args) { for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) { if ("Nimbus".equals(info.getName())) { try { UIManager.setLookAndFeel(info.getClassName()); } catch (Throwable ignored) { } break; } } EventQueue.invokeLater(new Runnable() { public void run () { new ParticleEditor(); } }); } }