System info
Retrieve information about the local system
Last week we used fonts from the underlying system. This week will gather more information about
system recourses and system specific attributes.
|
Environment variables, also refereed to as properties in Java, contains user settings and pointers to
external data, e.g. the PATH and CLASSPATH variable. Implement an application that shows all environment
variables available to Java.
Hint:
System.getProperties()
ShowProperties.java
|
|
The amount of system memory is often not relevant when working inside the JVM, however
the memory available in the JVM is interesting. Write a small application that uses the method in
java.lang.Runtime to retrieve information about JVM memory.
ShowMemInfo.java
|
|
If you work in a graphical environment, and make GUI-applications, it would be nice to know attributes of that environment.
Write an application that shows the information about the screen: width,height, bit depth and refresh rate.
Hint:
java.awt.DisplayMode
ShowDisplaySettings.java
|
|
The last system resource to investigate this week, is your network, if any. Here, the most relevant information
would be your IP number. Implement an application what show your current IP number or reports if there is now
network available.
Hint:
java.net.InetAddress
ShowIP.java
|
|
Finally, this week, you could make an application that implements all the small programs above. This would be
your little Java System Information utility.
|
|
|