Solved

OS detection

Posted on 2004-04-14
6
319 Views
Last Modified: 2010-03-31
Hey is there a way to detect if my program is running on a mac or windows machine, because i want to keep the look and feel of each, but need to make small changes.

Thanks
0
Comment
Question by:DrunkenTigerDDD
  • 3
  • 2
6 Comments
 
LVL 92

Expert Comment

by:objects
ID: 10829471
UIManager.getSystemLookAndFeelClassName()  
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 100 total points
ID: 10829475
System.getProperty("os.name");
0
 
LVL 92

Expert Comment

by:objects
ID: 10829477
String os = System.getProperty("os.name");
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 92

Expert Comment

by:objects
ID: 10829479
no need to in fact know the OS to use the native L&F.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10829641
8-)
0
 

Author Comment

by:DrunkenTigerDDD
ID: 10829699
Thanks
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
advertisement module in core php 4 159
servlet  URL Rewriting 1 36
Facing this issue for maven proxy setting 2 9
CSV file parsing thru Java 13 26
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

806 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question