WindowsLookAndFeel on non-Windows hack

  • Thread starter =?iso-8859-1?Q?Nils_O=2E_Sel=E5sdal?=
  • Start date
?

=?iso-8859-1?Q?Nils_O=2E_Sel=E5sdal?=

try {
//load a L&F that works first.
UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel");
System.setProperty("os.name", "Windows");
System.setProperty("os.version", "5.1");

UIManager.setLookAndFeel(
"com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
} catch (Exception ex) {
ex.printStackTrace();
}

This is actually quite imortant to me, as I have to assure my GUI's
also looks good with the windows L&F.
 
S

Steve W. Jackson

Nils O. Selåsdal said:
:try {
: //load a L&F that works first.
: UIManager.setLookAndFeel("com.sun.java.swing.plaf.gtk.GTKLookAndFeel")
: ;
: System.setProperty("os.name", "Windows");
: System.setProperty("os.version", "5.1");
:
: UIManager.setLookAndFeel(
: "com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
: } catch (Exception ex) {
: ex.printStackTrace();
: }
:
:This is actually quite imortant to me, as I have to assure my GUI's
:also looks good with the windows L&F.


You may want to be aware that this is illegal -- as in a copyright
violation. That's why Java does not include the Windows L&F on
non-Windows platforms, or the Mac L&F on non-Mac platforms, etc.

= Steve =
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top