aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Please run the program in pure Unix Box Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Please run the program in pure Unix Box" Watch "Please run the program in pure Unix Box" New topic
Author

Please run the program in pure Unix Box

Ailsa Cape
Ranch Hand

Joined: Aug 10, 2005
Posts: 92
Hi, everyone!

Now I design a program, the following code is the GUI section. Because I need precise size and location for every component, I have to use the setBounds method to achieve this. But I heard that using such method which depends on the absolute location may cause some of the components changing their sizes and positions when the program runs in different operation systems. I tested it in Windows 2000 professional, it looks nice. But I don't have pure Unix Box on my machine, I beg you for help. please run it in the pure Unix system and upload the look and feel result in the reply post.

By the way, how can I implement the same look and feel appearance using Layout settings instead of setBounds method?



Thanks in advance!
Regards, Ailsa Cape
[ September 18, 2005: Message edited by: Ailsa Cape ]
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8927
    
    9

Originally posted by Ailsa Cape:
But I don't have pure Unix Box on my machine,


Knoppix is full-featured Linux distribution that runs from a bootable CD. Nothing to install, just put the CD in your drive and reboot.


By the way, how can I implement the same look and feel appearance using Layout settings instead of setBounds method?


Have a look at the Java Tutorial chapter on Laying out Components


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Ailsa Cape
Ranch Hand

Joined: Aug 10, 2005
Posts: 92
Hi, Joe

Thank you for your answers.
Now I understand Knoppix is a really powerful utilities. However I can't find one in my city. Would you like to run the above code(just copy and paste it) on the Knoppix for me?

Thanks in advance!
Regards, Ailsa Cape
[ September 19, 2005: Message edited by: Ailsa Cape ]
Stephen Boston
Ranch Hand

Joined: Jul 14, 2005
Posts: 165
Actually, the link he gave you on KNOPPIX is a OS that you can run on your PC that you can use to test your app. It is CD based so you don't have to worry about wiping your windows OS.

You can download the KNOPPIX OS from that link.


Steve<br /> <br />No matter where you go, there you are.<br /> <br />"My evil self is at the door, and I have no power to stop it."
Ailsa Cape
Ranch Hand

Joined: Aug 10, 2005
Posts: 92
Hi,Stephen

Thank you! Although it will take me almost 17 hours to download the sofeware, I'll try that.

Regards, Ailsa Cape
Stephen Boston
Ranch Hand

Joined: Jul 14, 2005
Posts: 165
Whoops! I forget sometimes that not everyone is on broadband.

I wanted a copy of the OS anyway. Once I get it to a DVD I'll fire it up and try your code.

Steve
Stephen Boston
Ranch Hand

Joined: Jul 14, 2005
Posts: 165
Ailsa.

OK, just to give you an update. I have the OS on a DVD now and booted it last night. It was fairly late when I did this so I didn't get a chance to test your code. I will do that tonight and let you know how it looks.

Steve
Ailsa Cape
Ranch Hand

Joined: Aug 10, 2005
Posts: 92
Hi, Stephen

Thank you a million!

I am sorry for coming late since I have been busy to prepare the SCJD and SCWCD exam recently. I am eagar to know the result in the Linux System. I beg you for uploading it.

Thanks in advance!

Regards, Ailsa Cape
Stephen Boston
Ranch Hand

Joined: Jul 14, 2005
Posts: 165
Well I ran into a slight snag. I had to do some web work for a club I belong to so I had to back burner our little project.

I will attend to that tonight and give you the results ASAP.

Steve
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8927
    
    9

Here is your app running on Gentoo Linux, JDK 1.4.2_09, xorg X11 and kde. Your results will vary depending on your platform's particular setup.
I had to make one change to get it to work under JDK 1.4.2. One cannot use JFrame.add(). It is necessary to get the content pane of a JFrame and add GUI components to it:
Stephen Boston
Ranch Hand

Joined: Jul 14, 2005
Posts: 165
Nice! I like that look and feel it has.
Ailsa Cape
Ranch Hand

Joined: Aug 10, 2005
Posts: 92
Hi, Joe

I really appreciate your great help.
I find the appearance of this program in Gentoo Linux is basically the same as that in Windows 2000.
I am sorry for not mentioning the JDK version when I tested it in Windows 2000. I used the JDK 1.5.0_02 to compile this java file and I got the success message. I don't realize the JDK 1.4.2_09 will report that error. Thank you again for correcting it and testing it.

Hi, Stephen

Thank you again. It is very kind of you to help me when you are busy working for a club.

Best Regards, Ailsa Cape
Stephen Boston
Ranch Hand

Joined: Jul 14, 2005
Posts: 165
Originally posted by Ailsa Cape:
Hi, Joe

I really appreciate your great help.
I find the appearance of this program in Gentoo Linux is basically the same as that in Windows 2000.
I am sorry for not mentioning the JDK version when I tested it in Windows 2000. I used the JDK 1.5.0_02 to compile this java file and I got the success message. I don't realize the JDK 1.4.2_09 will report that error. Thank you again for correcting it and testing it.

Hi, Stephen

Thank you again. It is very kind of you to help me when you are busy working for a club.

Best Regards, Ailsa Cape



No problem! We are getting close to Nationals and everyone has updates they want up on the web page. And of cousre it is not properly formatted for the page. (And then they change their minds. ugh! )

I did manage to get to your program despite all that. I don't have a screen shot for you, I was having trouble getting the network up for some reason. (a task for another day), but after the making the changes Joe suggested it compiled just fine and displayed very close to what Joe had. Everything lined up just like the version I ran in windows. Looks like a winner to me.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Please run the program in pure Unix Box