aspose file tools*
The moose likes Java in General and the fly likes Creating System Information GUI Boxes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Creating System Information GUI Boxes" Watch "Creating System Information GUI Boxes" New topic
Author

Creating System Information GUI Boxes

Kesha Williams
Greenhorn

Joined: Sep 26, 2006
Posts: 3
I really would sincerely appreciate the help because I am not sure where to start.

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.

Criteria:
(1) GUI output, layout must be professional. (50%)
(2) Display the system information required. (50%)
(3) Bonus for the excellent products. (20%)

(CPU INFO)
processor: 0
vendor_id: GenuineIntel
cpu family: 15
model: 3
model name: Intel(R) Pentium(R) 4 CPU 3.00GHz
stepping: 4
cpu MHz: 2993.999
cache size: 1024 KB
physical id: 0
siblings: 2
core id: 0
cpu cores: 1
fdiv_bug: no
hlt_bug: no
f00f_bug: no
coma_bug: no
fpu: yes
fpu_exception: yes
cpuid level: 5
wp: yes
flags: fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe pni monitor ds_cpl cid xtpr
bogomips: 5914.62

processor: 1
vendor_id: GenuineIntel
cpu family: 15
model: 3
model name: Intel(R) Pentium(R) 4 CPU 3.00GHz
stepping: 4
cpu MHz: 2993.999
cache size: 1024 KB
physical id: 0
siblings: 2
core id: 0
cpu cores: 1
fdiv_bug: no
hlt_bug: no
f00f_bug: no
coma_bug: no
fpu: yes
fpu_exception: yes
cpuid level: 5
wp: yes
flags: fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe pni monitor ds_cpl cid xtpr
bogomips: 5980.16

(MEMO INFO)

MemTotal: 514408 kB
MemFree: 178300 kB
Buffers: 7364 kB
Cached: 210256 kB
SwapCached: 0 kB
Active: 153096 kB
Inactive: 152220 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 514408 kB
LowFree: 178300 kB
SwapTotal: 2096444 kB
SwapFree: 2096444 kB
Dirty: 764 kB
Writeback: 0 kB
Mapped: 114248 kB
Slab: 20288 kB
CommitLimit: 2353648 kB
Committed_AS: 170604 kB
PageTables: 2796 kB
VmallocTotal: 507896 kB
VmallocUsed: 4324 kB
VmallocChunk: 503308 kB
HugePages_Total: 0
HugePages_Free: 0
Hugepagesize: 2048
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
> In this assignment,...

thank you for sharing.

do you have a question?
Kesha Williams
Greenhorn

Joined: Sep 26, 2006
Posts: 3
Originally posted by Michael Dunn:
> In this assignment,...

thank you for sharing.

do you have a question?


Well, I thought it was obvious but I was asking for help with this program to get the required output and I included all that.
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

Hi,

Welcome to JavaRanch!

What I think Michael was asking (although not unfortunately in a nice way) was, "What have you done so far? Where are you stuck?" Do you have an idea of the basic structure of the program? How to display a GUI window (if indeed that's the requirement; the assignment doesn't seem to say that)? How to read files? Since you're brand new here at the Ranch, we don't know where you are on the larnin' curve.


[Jess in Action][AskingGoodQuestions]
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
OK, may have been a bit terse, but I have seen too many "do my homework for me" posts,
where the OP is never heard from again, regardless of how nicely the request
is put for them to post what they have done so far.

Kesha has responded, so I'll try to be a little more helpful with this.


as it is, it looks like a lot of work. Don't worry about that.
break the assignment down to little pieces - you have (a) to (g), so throw away (b) to (g)

now your assignment is just this (a lot more 'visually' manageable)

"you need to print out system information including:
a. Display mode
Width
Height
Bit depth
Refresh rate"

and you are given

"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();
}"

work on solving just this, nothing else - don't even worry about the gui stuff (yet)

repeat for each of (b) to (g), again separately

when you are satisfied your coding solves all the problems, converting to
a gui is not overly difficult - mostly changing System.out.println's to
component.setText(...) or setValueAt(...) etc - perhaps the hardest part
is selecting the right components to display the data (this seems to be the 20% bonus)

have a go, but if you get stuck, post what specific problem you have, along
with the code you have tried.

good luck
Kesha Williams
Greenhorn

Joined: Sep 26, 2006
Posts: 3
Thanks Mike and Ernest. I am going to try what Mike suggested with the little pieces. I think looking at the whole project just overwhelmed me. I will get back to you with what I have completed. Of course my professors don't break it down like that, they just give you a project to do. But that's life I guess.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Creating System Information GUI Boxes