how to detect platform?

J

juventuz2000

What I really want to do is set the look and feel according to
platform, win-lnf for windows, gtk-lnf for linux. I don't have a mac to
try it on, but the same for mac would make sense.

When I use getSystemLookAndFeelClassName() I still get the butt ugly
metal on linux, so I'd like some way to detect which platform I'm on so
I can set the lnf accordingly..

Also, does the gtk lnf work on Windows? I've tried with sun-jdk15 and
sun-jre15, none of which seem to have it.
 
R

R.F. Pels

metal on linux, so I'd like some way to detect which platform I'm on so
I can set the lnf accordingly..

Consult the system properties:

System.out.println(System.getProperty("os.name"));

and work from there. @see UIManager
Also, does the gtk lnf work on Windows? I've tried with sun-jdk15 and
sun-jre15, none of which seem to have it.

Probably not.
 

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,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top