private static void createAndShowGUI() { try { UIManager.setLookAndFeel(new TestLookAndFeel()); JLabel label = new JLabel("Test Label"); label.setSize(SIZE, SIZE); TitledBorder border = new TitledBorder("ABCDEF"); label.setBorder(new TitledBorder(border)); if (useLAF) { UIManager.setLookAndFeel(new NimbusLookAndFeel()); } else { UIManager.getDefaults().put("LabelUI", MetalLabelUI.class.getName()); } SwingUtilities.updateComponentTreeUI(label); paintToImage(label); } catch (Exception e) { throw new RuntimeException(e); } }
private static void setupUILAF() { try { @SuppressWarnings("serial") LookAndFeel laf = new NimbusLookAndFeel() { @Override public UIDefaults getDefaults() { UIDefaults ret = super.getDefaults(); ret.put("defaultFont", Util.normalFont); return ret; } }; UIManager.setLookAndFeel(laf); } catch (Exception e) { e.printStackTrace(); } }
private void init(){ try { javax.swing.UIManager.setLookAndFeel(new NimbusLookAndFeel()); javax.swing.SwingUtilities.updateComponentTreeUI(this); } catch (UnsupportedLookAndFeelException exc) { System.out.println("Nimbus LookAndFeel not loaded : "+exc); } cbMode.setModel(comboModelMode); for(ModeType mode : ModeType.values()){ comboModelMode.addElement(mode); } cbMode.setSelectedIndex(0); // Force le rendu de lblSummary cbTreatment.setModel(comboModelTreatment); for(TreatmentType tr : TreatmentType.values()){ comboModelTreatment.addElement(tr); } cbTreatment.setSelectedIndex(0); // Force le rendu de lblSummary }
public static void main(String[] args) throws Exception { UIManager.setLookAndFeel(new NimbusLookAndFeel()); Robot robot = new Robot(); robot.setAutoDelay(50); SunToolkit toolkit = (SunToolkit) Toolkit.getDefaultToolkit(); SwingUtilities.invokeAndWait(new Runnable() { public void run() { createAndShowGUI(); } }); toolkit.realSync(); SwingUtilities.invokeAndWait(new Runnable() { public void run() { Component previewPanel = Util.findSubComponent(cc, "javax.swing.colorchooser.DefaultPreviewPanel"); point = previewPanel.getLocationOnScreen(); } }); point.translate(5, 5); robot.mouseMove(point.x, point.y); robot.mousePress(InputEvent.BUTTON1_MASK); robot.mouseRelease(InputEvent.BUTTON1_MASK); }
public static void main(String[] args) throws Exception { UIManager.setLookAndFeel(new NimbusLookAndFeel()); Test6919629 t = new Test6919629(); t.test(); System.gc(); t.check(); }
public static void main(String[] args) throws Exception { nimbus = new NimbusLookAndFeel(); try { UIManager.setLookAndFeel(nimbus); } catch (UnsupportedLookAndFeelException e) { throw new Error("Unable to set Nimbus LAF"); } SwingUtilities.invokeAndWait(new Runnable() { @Override public void run() { new ColorCustomizationTest().test(); } }); }
public static void main(String[] args) throws Exception { UIManager.setLookAndFeel(new NimbusLookAndFeel()); SwingUtilities.invokeAndWait(new Runnable() { public void run() { new JLabel(); UIDefaults uid = UIManager.getDefaults(); uid.putDefaults(new Object[0]); uid.put("what.ever", "else"); } }); }
public static void main(String[] args) throws Exception { UIManager.setLookAndFeel(new NimbusLookAndFeel()); Robot robot = new Robot(); robot.setAutoDelay(50); SwingUtilities.invokeAndWait(new Runnable() { public void run() { createAndShowGUI(); } }); robot.waitForIdle(); SwingUtilities.invokeAndWait(new Runnable() { public void run() { Component previewPanel = Util.findSubComponent(cc, "javax.swing.colorchooser.DefaultPreviewPanel"); point = previewPanel.getLocationOnScreen(); } }); point.translate(5, 5); robot.mouseMove(point.x, point.y); robot.mousePress(InputEvent.BUTTON1_MASK); robot.mouseRelease(InputEvent.BUTTON1_MASK); }
public static void main(String... args) throws Exception { UIManager.setLookAndFeel(new NimbusLookAndFeel()); SwingUtilities.invokeAndWait(new Runnable() { public void run() { new bug6937798(); } }); }
private static boolean tryNimbusLookAndFeel() throws Exception { try { UIManager.setLookAndFeel(new NimbusLookAndFeel()); } catch (UnsupportedLookAndFeelException e) { errorString += e.getMessage(); return false; } return true; }
/** * 初始化look and feel */ public static void initTheme() { try { switch (configer.getTheme()) { case "BeautyEye": BeautyEyeLNFHelper.launchBeautyEyeLNF(); UIManager.put("RootPane.setupButtonVisible", false); break; case "weblaf": UIManager.setLookAndFeel(new WebLookAndFeel()); break; case "系统默认": UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); break; case "Windows": UIManager.setLookAndFeel(WindowsLookAndFeel.class.getName()); break; case "Nimbus": UIManager.setLookAndFeel(NimbusLookAndFeel.class.getName()); break; case "Metal": UIManager.setLookAndFeel(MetalLookAndFeel.class.getName()); break; case "Motif": UIManager.setLookAndFeel(MotifLookAndFeel.class.getName()); break; case "Darcula(推荐)": default: UIManager.setLookAndFeel("com.bulenkov.darcula.DarculaLaf"); } } catch (Exception e) { logger.error(e); } }
public static void main(String[] args) { try { UIManager.setLookAndFeel(new NimbusLookAndFeel()); } catch (UnsupportedLookAndFeelException ex) { Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex); } MainWindow mainWindow = new MainWindow(); mainWindow.setResizable(false); mainWindow.setLocationRelativeTo(null); mainWindow.setVisible(true); }
public static void main(String[] args) { //Startup message System.out.println("Now Starting Level Editor 2.0"); try { UIManager.setLookAndFeel(new NimbusLookAndFeel());} catch (UnsupportedLookAndFeelException e) {} //Open project folder File projectDir = Util.getDir(new File(new File("."), DIR_NAME)); //Open the project new Project(projectDir).edit(); }
public static void main(String args[]) { try { UIManager.setLookAndFeel(new NimbusLookAndFeel()); } catch (Exception ex) { } new StreamPreview().setVisible(true); }
public void updateGUI() { updateNimbus(); for (Component component : mFrame.getComponents()) { component.repaint(); } for (Window window : Window.getWindows()) { // SwingUtilities.updateComponentTreeUI(window); NimbusLookAndFeel.updateStyles(window); } updateColorButtons(); }
private static void openMainForm(String title, Parameters parameters) { try { UIManager.setLookAndFeel(new NimbusLookAndFeel()); } catch (UnsupportedLookAndFeelException e) { throw new RuntimeException(e); } MainFrame form = new MainFrame(title, parameters); form.pack(); form.setLocationRelativeTo(null); form.setVisible(true); }
private void init(){ try { javax.swing.UIManager.setLookAndFeel(new NimbusLookAndFeel()); javax.swing.SwingUtilities.updateComponentTreeUI(this); } catch (UnsupportedLookAndFeelException exc) { System.out.println("Nimbus LookAndFeel not loaded : "+exc); } //-- dim >> Obtient la taille de l'écran //-- gconf >> Obtient la configuration de l'écran //-- insets >> Obtient les 'marges' de l'écran java.awt.Toolkit toolkit = java.awt.Toolkit.getDefaultToolkit(); java.awt.Dimension dim = toolkit.getScreenSize(); java.awt.GraphicsConfiguration gconf = java.awt.GraphicsEnvironment .getLocalGraphicsEnvironment().getDefaultScreenDevice() .getDefaultConfiguration(); java.awt.Insets insets = toolkit.getScreenInsets(gconf); setSize(dim.width - insets.left - insets.right, dim.height - insets.top - insets.bottom); s2d.setPreferredSize(new Dimension(2000, 2000)); spSheet2D.setViewportView(s2d); s2d.revalidate(); spSheet2D.updateUI(); listConcentricShapes.setCellRenderer(new ConcentricListRenderer()); listConcentricShapes.setModel(concentricListModel); }