List of usage examples for javax.swing UIManager put
public static Object put(Object key, Object value)
From source file:MainClass.java
public static void main(final String args[]) { UIManager.put("OptionPane.cancelButtonText", "Annuler"); UIManager.put("OptionPane.noButtonText", "Non"); UIManager.put("OptionPane.okButtonText", "D'accord"); UIManager.put("OptionPane.yesButtonText", "Oui"); int result = JOptionPane.showConfirmDialog(new JFrame(), "Est-ce que vous avez 18 ans ou plus?", "Choisisez une option", JOptionPane.YES_NO_CANCEL_OPTION); if (result == JOptionPane.YES_OPTION) { System.out.println("Yes"); } else if (result == JOptionPane.NO_OPTION) { System.out.println("No"); } else if (result == JOptionPane.CANCEL_OPTION) { System.out.println("Cancel"); } else if (result == JOptionPane.CLOSED_OPTION) { System.out.println("Closed"); }// ww w . jav a 2s .c om }
From source file:UIDefaultsButton.java
License:asdf
public static void main(String[] args) { UIManager.put("Button.background", Color.BLACK); UIManager.put("Button.foreground", Color.RED); JFrame aWindow = new JFrame("This is a Border Layout"); aWindow.setBounds(30, 30, 300, 300); // Size aWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JButton bn = new JButton("asdf"); aWindow.add(bn);//from w w w . j av a 2 s . c o m aWindow.setVisible(true); // Display the window }
From source file:ConfigOptionPaneLanguage.java
public static void main(final String[] args) { // /* w ww .j a v a2 s .c om*/ UIManager.put("OptionPane.cancelButtonText", "Annuler"); UIManager.put("OptionPane.noButtonText", "Non"); UIManager.put("OptionPane.okButtonText", "D'accord"); UIManager.put("OptionPane.yesButtonText", "Oui"); JFrame parent = new JFrame(); String multiLineMsg[] = { "Hello,", "World" }; JOptionPane.showMessageDialog(parent, multiLineMsg); }
From source file:Main.java
public static void main(String args[]) { UIManager.put("ProgressBar.repaintInterval", 100); UIManager.put("ProgressBar.border", BorderFactory.createLineBorder(Color.blue, 2)); JFrame f = new JFrame(); f.setLayout(new GridLayout(0, 1, 5, 5)); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.add(createBar());/* w w w . j av a 2 s . c o m*/ f.add(createBar()); f.add(createBar()); f.pack(); f.setLocationRelativeTo(null); f.setVisible(true); }
From source file:Main.java
public static void main(String[] args) throws Exception { ImageIcon icon = new ImageIcon(new URL("http://www.java2s.com/style/download.png")); UIManager.put("OptionPane.informationIcon", icon); JOptionPane.showMessageDialog(null, "Hello!"); }
From source file:Main.java
public static void main(String[] argv) throws Exception { String message = "Description of Task"; String note = "subtask"; String title = "Task Title"; UIManager.put("ProgressMonitor.progressText", title); int min = 0;/*from ww w .j a va 2 s. co m*/ int max = 100; JFrame component = new JFrame(); ProgressMonitor pm = new ProgressMonitor(component, message, note, min, max); int millisToPopup = pm.getMillisToPopup(); // 2000 int millisToDecideToPopup = pm.getMillisToDecideToPopup(); // 500 pm.setMillisToPopup(0); pm.setMillisToDecideToPopup(0); }
From source file:Main.java
public static void main(String[] argv) throws Exception { String message = "Description of Task"; String note = "subtask"; String title = "Task Title"; UIManager.put("ProgressMonitor.progressText", title); int min = 0;//from ww w. j av a2 s . c o m int max = 100; JFrame component = new JFrame(); ProgressMonitor pm = new ProgressMonitor(component, message, note, min, max); boolean cancelled = pm.isCanceled(); if (cancelled) { System.out.println("Stop task"); } else { pm.setProgress(100); pm.setNote("New Note"); } }
From source file:Main.java
public static void main(String[] argv) { Object lazyValue = new UIDefaults.LazyValue() { public Object createValue(UIDefaults table) { return new JPanel(); }/* www .j av a 2 s .c om*/ }; UIManager.put("key", lazyValue); Object value = UIManager.get("key"); }
From source file:Main.java
public static void main(String[] argv) { Object activeValue = new UIDefaults.ActiveValue() { public Object createValue(UIDefaults table) { return new Date(); }//from www.ja v a2 s . com }; UIManager.put("key", activeValue); Date d1 = (Date) UIManager.get("key"); Date d2 = (Date) UIManager.get("key"); boolean b = d1.equals(d2); // false }
From source file:ActiveSample.java
public static void main(String args[]) { JFrame frame = new JFrame("Active Example"); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); UIManager.put(LABEL_FACTORY, new ActiveLabel()); final JPanel panel = new JPanel(); JButton button = new JButton("Get"); ActionListener actionListener = new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { JLabel label = (JLabel) UIManager.get(LABEL_FACTORY); panel.add(label);// w ww . j a v a 2 s.c o m panel.revalidate(); } }; button.addActionListener(actionListener); frame.add(panel, BorderLayout.CENTER); frame.add(button, BorderLayout.SOUTH); frame.setSize(200, 200); frame.setVisible(true); }