List of usage examples for javax.swing UIManager put
public static Object put(Object key, Object value)
From source file:ComponentHier.java
public static void main(String args[]) { JFrame frame = new JFrame("JComponent Hierarchy"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Font font = (Font) UIManager.get("Tree.font"); font = new Font(font.getFontName(), Font.BOLD, font.getSize() - 3); UIManager.put("Tree.font", font); Vector jEditorPaneVector = new NamedVector("JEditorPane", new Object[] { "JTextPane" }); Vector jTextFieldVector = new NamedVector("JTextField", new Object[] { "JPasswordField" }); Vector jTextComponentVector = new NamedVector("JTextComponent", new Object[] { jEditorPaneVector, "JTextArea", jTextFieldVector }); Vector jLayeredPaneVector = new NamedVector("JLayeredPane", new Object[] { "JDesktopPane" }); Vector jToggleButtonVector = new NamedVector("JToggleButton", new Object[] { "JCheckBox", "JRadioButton" }); Vector jMenuItemVector = new NamedVector("JMenuItem", new Object[] { "JCheckBoxMenuItem", "JMenu", "JRadioButtonMenuItem" }); Vector abstractButtonVector = new NamedVector("Abstract Button", new Object[] { "JButton", jMenuItemVector, jToggleButtonVector }); Object jComponentNodes[] = { abstractButtonVector, "JColorChooser", "JComboBox", "JFileChooser", "JInternalFrame", "JLabel", jLayeredPaneVector, "JList", "JMenuBar", "JOptionPane", "JPanel", "JPopupMenu", "JProgressBar", "JRootPane", "JScrollBar", "JScrollPane", "JSeparator", "JSlider", "JSplitPane", "JTabbedPane", "JTable", jTextComponentVector, "JToolBar", "JTree", "JViewPort" }; Vector jComponentVector = new NamedVector("JComponent", jComponentNodes); Object rootNodes[] = { jComponentVector }; Vector rootVector = new NamedVector("Root", rootNodes); JTree tree = new JTree(rootVector); tree.putClientProperty("JTree.lineStyle", "Angled"); JScrollPane scrollPane = new JScrollPane(tree); frame.getContentPane().add(scrollPane, BorderLayout.CENTER); frame.setSize(250, 480);//from w w w . j a v a2 s . co m frame.setVisible(true); }
From source file:LazySample.java
public static void main(String args[]) { JFrame frame = new JFrame("Lazy Example"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Integer fifteen = new Integer(15); Object lazyArgs[] = new Object[] { Color.GREEN, Boolean.TRUE, fifteen, fifteen }; Object lazyDiamond = new UIDefaults.ProxyLazyValue("MyIcon", lazyArgs); UIManager.put("Tree.openIcon", lazyDiamond); JTree tree = new JTree(); JScrollPane scrollPane = new JScrollPane(tree); frame.add(scrollPane, BorderLayout.CENTER); frame.setSize(200, 200);/*w ww . j a v a 2 s.com*/ frame.setVisible(true); }
From source file:MainClass.java
public static void main(String args[]) { UIManager.put("ProgressMonitor.progressText", "This is progress?"); new MainClass(); }
From source file:MetalModExample.java
public static void main(String[] args) { try {// w w w . j a v a 2 s . c o m UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel"); } catch (Exception e) { System.err.println("Metal is not available on this platform?!"); System.exit(1); } JComponent before = makeExamplePane(); UIManager.put("ScrollBarUI", "MyMetalScrollBarUI"); JComponent after = makeExamplePane(); JFrame f = new JFrame(); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Container c = f.getContentPane(); c.setLayout(new GridLayout(2, 1, 0, 1)); c.add(before); c.add(after); f.setSize(450, 400); f.setVisible(true); }
From source file:Main.java
public static void main(String args[]) { UIManager.put("ProgressMonitor.progressText", "This is progress?"); UIManager.put("OptionPane.cancelButtonText", "Go Away"); new Main();/*from www. j a v a2s . co m*/ }
From source file:ResourceModExample.java
public static void main(String[] args) { Border border = BorderFactory.createRaisedBevelBorder(); Border tripleBorder = new CompoundBorder(new CompoundBorder(border, border), border); UIManager.put("Button.border", tripleBorder); UIManager.put("InternalFrame.closeIcon", new ImageIcon("close.gif")); UIManager.put("InternalFrame.iconizeIcon", new ImageIcon("iconify.gif")); UIManager.put("InternalFrame.maximizeIcon", new ImageIcon("maximize.gif")); UIManager.put("InternalFrame.altMaximizeIcon", new ImageIcon("altMax.gif")); UIManager.put("InternalFrame.titleFont", new Font("Serif", Font.ITALIC, 12)); UIManager.put("ScrollBar.width", new Integer(30)); JFrame f = new JFrame(); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Container c = f.getContentPane(); JDesktopPane desk = new JDesktopPane(); c.add(desk, BorderLayout.CENTER); JButton cut = new JButton("Cut"); JButton copy = new JButton("Copy"); JButton paste = new JButton("Paste"); JPanel p = new JPanel(new FlowLayout()); p.add(cut);// w ww . j a v a 2 s . com p.add(copy); p.add(paste); c.add(p, BorderLayout.SOUTH); JInternalFrame inf = new JInternalFrame("MyFrame", true, true, true, true); JLabel l = new JLabel(new ImageIcon("luggage.jpeg")); JScrollPane scroll = new JScrollPane(l); inf.setContentPane(scroll); inf.setBounds(10, 10, 350, 280); desk.add(inf); inf.setVisible(true); f.setSize(380, 360); f.setVisible(true); }
From source file:Main.java
public static void main(String[] argv) throws Exception { Locale locale = Locale.getDefault(); ResourceBundle rb = ResourceBundle.getBundle("JFileChooser", locale); UIManager.put("FileChooser.lookInLabelText", rb.getString("lookInLabelText")); UIManager.put("FileChooser.filesOfTypeLabelText", rb.getString("filesOfTypeLabelText")); UIManager.put("FileChooser.upFolderToolTipText", rb.getString("upFolderToolTipText")); }
From source file:com.milkdairy.admin.MilkDairyManagement.java
public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { public void run() { Resource resource = new ClassPathResource("applicationContext.xml"); BeanFactory factory = new XmlBeanFactory(resource); JPanel milkDairyManagementJPanel = (MilkDairyManagementJPanel) factory .getBean("milkDairyManagementJPanel"); UIManager.put("swing.boldmetal", Boolean.FALSE); new LoginJFrame(milkDairyManagementJPanel, (LoggingService) factory.getBean("loggingService")) .setVisible(true);//from www . ja v a 2 s . c o m } }); }
From source file:TreeNodeVector.java
public static void main(final String args[]) { JFrame frame = new JFrame("JTreeSample"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); Vector<String> v1 = new TreeNodeVector<String>("Two", new String[] { "Mercury", "Venus", "Mars" }); Vector<Object> v2 = new TreeNodeVector<Object>("Three"); v2.add(System.getProperties()); v2.add(v1);//from www. j a v a 2s .c o m Object rootNodes[] = { v1, v2 }; Vector<Object> rootVector = new TreeNodeVector<Object>("Root", rootNodes); JTree tree = new JTree(rootVector); UIManager.put("Tree.line", Color.GREEN); tree.putClientProperty("JTree.lineStyle", "Horizontal"); frame.add(new JScrollPane(tree), BorderLayout.CENTER); frame.setSize(300, 300); frame.setVisible(true); }
From source file:ProgressMonitorExample.java
public static void main(String args[]) { UIManager.put("ProgressMonitor.progressText", "This is progress?"); UIManager.put("OptionPane.cancelButtonText", "Go Away"); new ProgressMonitorExample(); }