List of usage examples for javax.swing UIManager put
public static Object put(Object key, Object value)
From source file:events.MouseWheelEventDemo.java
public static void main(String[] args) { /* Use an appropriate Look and Feel */ try {/* ww w. j a v a 2 s . com*/ //UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); //UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel"); UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); } catch (UnsupportedLookAndFeelException ex) { ex.printStackTrace(); } catch (IllegalAccessException ex) { ex.printStackTrace(); } catch (InstantiationException ex) { ex.printStackTrace(); } catch (ClassNotFoundException ex) { ex.printStackTrace(); } /* Turn off metal's use of bold fonts */ UIManager.put("swing.boldMetal", Boolean.FALSE); //Schedule a job for the event dispatch thread: //creating and showing this application's GUI. javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { createAndShowGUI(); } }); }
From source file:CheckBoxSample.java
public static void main(String args[]) { ActionListener aListener = new ActionListener() { public void actionPerformed(ActionEvent event) { AbstractButton aButton = (AbstractButton) event.getSource(); boolean selected = aButton.getModel().isSelected(); String newLabel;/*from w ww .ja va 2 s. c o m*/ Icon newIcon; if (selected) { newLabel = "Girl"; newIcon = girlIcon; } else { newLabel = "Boy"; newIcon = boyIcon; } aButton.setText(newLabel); aButton.setIcon(newIcon); } }; ItemListener iListener = new ItemListener() { public void itemStateChanged(ItemEvent event) { AbstractButton aButton = (AbstractButton) event.getSource(); int state = event.getStateChange(); String newLabel; Icon newIcon; if (state == ItemEvent.SELECTED) { newLabel = "Girl"; newIcon = girlIcon; } else { newLabel = "Boy"; newIcon = boyIcon; } aButton.setText(newLabel); aButton.setIcon(newIcon); } }; JFrame frame = new JFrame("CheckBox Example"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JMenuBar bar = new JMenuBar(); JMenu menu = new JMenu("Menu"); menu.setMnemonic(KeyEvent.VK_M); JCheckBoxMenuItem one = new JCheckBoxMenuItem(); menu.add(one); JCheckBoxMenuItem two = new JCheckBoxMenuItem("Boy"); menu.add(two); JCheckBoxMenuItem three = new JCheckBoxMenuItem(boyIcon); menu.add(three); JCheckBoxMenuItem four = new JCheckBoxMenuItem("Girl", true); menu.add(four); JCheckBoxMenuItem five = new JCheckBoxMenuItem("Boy", boyIcon); five.addItemListener(iListener); menu.add(five); Icon stateIcon = new DiamondAbstractButtonStateIcon(Color.black); UIManager.put("CheckBoxMenuItem.checkIcon", stateIcon); JCheckBoxMenuItem six = new JCheckBoxMenuItem("Girl", girlIcon, true); six.addActionListener(aListener); menu.add(six); bar.add(menu); frame.setJMenuBar(bar); frame.setSize(350, 250); frame.setVisible(true); }
From source file:Sketch.java
public static void main(String[] args) { UIManager.put(JogShuttleUI.UI_CLASS_ID, "BasicJogShuttleUI"); Sketch s = new Sketch(); JFrame frame = new JFrame("Sample Sketch Application"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setContentPane(s);//from w w w . j a v a2s .c om frame.pack(); frame.setVisible(true); }
From source file:com.aan.girsang.client.launcher.ClientLauncher.java
public static void main(String[] args) throws Exception { BeautyEyeLNFHelper.frameBorderStyle = BeautyEyeLNFHelper.FrameBorderStyle.generalNoTranslucencyShadow; org.jb2011.lnf.beautyeye.BeautyEyeLNFHelper.launchBeautyEyeLNF(); UIManager.put("RootPane.setupButtonVisible", Boolean.FALSE); try {/* w w w. j av a2s.c o m*/ AbstractApplicationContext ctx = new ClassPathXmlApplicationContext("clientContext.xml"); ctx.registerShutdownHook(); constantService = (ConstantService) ctx.getBean("constantServiceRemote"); securityService = (SecurityService) ctx.getBean("securityServiceRemote"); masterService = (MasterService) ctx.getBean("masterServiceRemote"); transaksiService = (TransaksiService) ctx.getBean("transaksiServiceRemote"); reportService = (ReportService) ctx.getBean("reportServiceRemote"); String computerName = InetAddress.getLocalHost().getHostName(); constantService.clientOnline(computerName); } catch (RemoteConnectFailureException ex) { String status = "Server Offline"; ex.printStackTrace(); log.info(ex.getMessage()); JOptionPane.showMessageDialog(null, status); System.exit(0); } log.info("Client Online"); java.awt.EventQueue.invokeLater(() -> { FrameUtama fu = new FrameUtama(); fu.setExtendedState(JFrame.MAXIMIZED_BOTH); fu.setVisible(true); fu.jam(); }); }
From source file:HelloWorldPrinter.java
public static void main(String args[]) { UIManager.put("swing.boldMetal", Boolean.FALSE); JFrame f = new JFrame("Hello World Printer"); f.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0);// ww w.j av a 2 s . com } }); JButton printButton = new JButton("Print Hello World"); printButton.addActionListener(new HelloWorldPrinter()); f.add("Center", printButton); f.pack(); f.setVisible(true); }
From source file:WindowEventDemo.java
public static void main(String[] args) { /* Use an appropriate Look and Feel */ try {//from w w w . ja v a 2 s. co m // UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); // UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel"); UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); } catch (UnsupportedLookAndFeelException ex) { ex.printStackTrace(); } catch (IllegalAccessException ex) { ex.printStackTrace(); } catch (InstantiationException ex) { ex.printStackTrace(); } catch (ClassNotFoundException ex) { ex.printStackTrace(); } /* Turn off metal's use of bold fonts */ UIManager.put("swing.boldMetal", Boolean.FALSE); // Schedule a job for the event dispatch thread: // creating and showing this application's GUI. javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { createAndShowGUI(); } }); }
From source file:PrintUIWindow.java
public static void main(String args[]) { UIManager.put("swing.boldMetal", Boolean.FALSE); JFrame f = new JFrame("Print UI Example"); f.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0);//from ww w . j av a 2s. c o m } }); JTextArea text = new JTextArea(50, 20); for (int i = 1; i <= 50; i++) { text.append("Line " + i + "\n"); } JScrollPane pane = new JScrollPane(text); pane.setPreferredSize(new Dimension(250, 200)); f.add("Center", pane); JButton printButton = new JButton("Print This Window"); printButton.addActionListener(new PrintUIWindow(f)); f.add("South", printButton); f.pack(); f.setVisible(true); }
From source file:misc.TablePrintDemo2.java
/** * Start the application./*from ww w. j a va2s . c om*/ */ public static void main(final String[] args) { /* Schedule for the GUI to be created and shown on the EDT */ SwingUtilities.invokeLater(new Runnable() { public void run() { /* Don't want bold fonts if we end up using metal */ UIManager.put("swing.boldMetal", false); try { UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); } catch (Exception e) { } new TablePrintDemo2().setVisible(true); } }); }
From source file:misc.ModalityDemo.java
public static void main(String[] args) { /* Use an appropriate Look and Feel */ try {/* w w w.j a v a 2 s .c om*/ //UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); } catch (UnsupportedLookAndFeelException ex) { ex.printStackTrace(); } catch (IllegalAccessException ex) { ex.printStackTrace(); } catch (InstantiationException ex) { ex.printStackTrace(); } catch (ClassNotFoundException ex) { ex.printStackTrace(); } /* Turn off metal's use of bold fonts */ UIManager.put("swing.boldMetal", Boolean.FALSE); //Schedule a job for the event-dispatching thread: //creating and showing this application's GUI. SwingUtilities.invokeLater(new Runnable() { public void run() { ModalityDemo md = new ModalityDemo(); md.createAndShowGUI(); md.start(); } }); }
From source file:misc.FocusConceptsDemo.java
public static void main(String[] args) { /* Use an appropriate Look and Feel */ try {/*from ww w . jav a 2 s.co m*/ //UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel"); //UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel"); UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); } catch (UnsupportedLookAndFeelException ex) { ex.printStackTrace(); } catch (IllegalAccessException ex) { ex.printStackTrace(); } catch (InstantiationException ex) { ex.printStackTrace(); } catch (ClassNotFoundException ex) { ex.printStackTrace(); } /* Turn off metal's use of bold fonts */ UIManager.put("swing.boldMetal", Boolean.FALSE); //Schedule a job for the event-dispatching thread: //creating and showing this application's GUI. javax.swing.SwingUtilities.invokeLater(new Runnable() { public void run() { createAndShowGUI(); } }); }