By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,761 Members | 1,193 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,761 IT Pros & Developers. It's quick & easy.

system information with GUI boxes

P: 1
I really would appreciate some help on this assignment. I need to make GUI boxes to display the system info such as on Microsoft Office. I have some code but not sure where to go with the rest of it. Help please. I will also include instructions that I was given.. I am working in JGrasp environment with Java.

In order to tuning programs to meet the hardware requirements and provide optimal performance, it is very important to retrieve system information for every program. In this assignment, you need to print out system information including:
a. Display mode
Width
Height
Bit depth
Refresh rate
b. OS information
Name
Version
Architecture
c. User information
Name
Country
Language
Home directory
Working directory
d. Java information
Java version
Installation path
Class path
Vendor
Vendor URL
e. Java Virtual Machine information
Total VM memory
Max VM memory
Free VM memory
f. CPU information
processor
vendor_id
model name
cpu MHZ
cache size
g. Physical memory information
MemTotal
MemFree
Buffers
Cached

To implement (a), you need to write codes like:

//The following codes are used to get display mode
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice[] gs = ge.getScreenDevices();
for (int j = 0; j < 1 /* gs.length */; j++) { //Only one display
DisplayMode dm = gs[j].getDisplayMode();
int width = dm.getWidth();
int height = dm.getHeight();
int bitdepth = dm.getBitDepth();
int refreshrate = dm.getRefreshRate();
}

To implement (b) to (e), you need to write codes like:

//The following codes are used to get OS information
System.out.println("Current OS Information");
System.out.println("Name " + System.getProperty("os.name"));
System.out.println("Version " + System.getProperty("os.version"));
System.out.println("Architecture " + System.getProperty("os.arch"));
//for others, you should check System.getProperty of JAVA.

To implement (f) and (g), you need to get information from two files (included in the assignment): \proc\cpuinfo and \proc\meminfo, and use StringTokenizer to retrieve required information from these two files.


It seems really simple but I feel I am just not knowledgeable enough to grasp it.
Sep 28 '06 #1
Share this Question
Share on Google+
1 Reply


10K+
P: 13,264
I really would appreciate some help on this assignment. I need to make GUI boxes to display the system info such as on Microsoft Office. I have some code but not sure where to go with the rest of it. Help please. I will also include instructions that I was given.. I am working in JGrasp environment with Java.

In order to tuning programs to meet the hardware requirements and provide optimal performance, it is very important to retrieve system information for every program. In this assignment, you need to print out system information including:
a. Display mode
Width
Height
Bit depth
Refresh rate
b. OS information
Name
Version
Architecture
c. User information
Name
Country
Language
Home directory
Working directory
d. Java information
Java version
Installation path
Class path
Vendor
Vendor URL
e. Java Virtual Machine information
Total VM memory
Max VM memory
Free VM memory
f. CPU information
processor
vendor_id
model name
cpu MHZ
cache size
g. Physical memory information
MemTotal
MemFree
Buffers
Cached

To implement (a), you need to write codes like:

//The following codes are used to get display mode
GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice[] gs = ge.getScreenDevices();
for (int j = 0; j < 1 /* gs.length */; j++) { //Only one display
DisplayMode dm = gs[j].getDisplayMode();
int width = dm.getWidth();
int height = dm.getHeight();
int bitdepth = dm.getBitDepth();
int refreshrate = dm.getRefreshRate();
}

To implement (b) to (e), you need to write codes like:

//The following codes are used to get OS information
System.out.println("Current OS Information");
System.out.println("Name " + System.getProperty("os.name"));
System.out.println("Version " + System.getProperty("os.version"));
System.out.println("Architecture " + System.getProperty("os.arch"));
//for others, you should check System.getProperty of JAVA.

To implement (f) and (g), you need to get information from two files (included in the assignment): \proc\cpuinfo and \proc\meminfo, and use StringTokenizer to retrieve required information from these two files.


It seems really simple but I feel I am just not knowledgeable enough to grasp it.
where exactly are you having problems?
Sep 28 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.