UIManager: put(Object key, Object value) : UIManager « javax.swing « Java by API






UIManager: put(Object key, Object value)

  
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.UIManager;

public class MainClass {

  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");
    }
  }

}


           
         
    
  








Related examples in the same category

1.UIManager.LookAndFeelInfo: getClassName()
2.UIManager.LookAndFeelInfo: getClassName() (2)
3.UIManager.LookAndFeelInfo: getName()
4.UIManager: get(Object key)
5.UIManager: getBorder(Object key)
6.UIManager: getCrossPlatformLookAndFeelClassName()
7.UIManager: getInstalledLookAndFeels()
8.UIManager: getLookAndFeelDefaults()
9.UIManager: getSystemLookAndFeelClassName()
10.UIManager: setLookAndFeel(String className)