0

I want to make a simple JOptionPane but don't want the Java buttons/icon theme instead would like the windows button/icon. Now can I change it to the windows theme?

user2526311
  • 1,004
  • 2
  • 10
  • 19

1 Answers1

1

Components are created using the current LAF. No guarantee that it will work but you can do something like:

  1. save current LAF
  2. set LAF to Windows
  3. display JOptionPane
  4. restore LAF to saved LAF

See How to Set the Look and Feel for more information.

camickr
  • 321,443
  • 19
  • 166
  • 288
  • Thanks for the link, solved the problem. What I did was add UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); – user2526311 Jun 29 '13 at 00:45
  • +1 for leveraging the native L&F; a related example is seen [here](http://stackoverflow.com/a/14262706/230513). – trashgod Jun 29 '13 at 10:49