aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Swing Buttons visible in Linux but not Windows Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Swing Buttons visible in Linux but not Windows" Watch "Swing Buttons visible in Linux but not Windows" New topic
Author

Swing Buttons visible in Linux but not Windows

juliane gross
Ranch Hand

Joined: May 30, 2002
Posts: 161
My java swing application shows it's Buttons nicely on my Linux System (where I developed it).
Then I transferred the app. via jar-file to Windows98.
There the labels are displayed but not the Buttons.

Any idea what could be the cause?
Thank you!
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8927
    
    9

Jeez, what DOES run on Win98 correctly?
Seriously, the first thing you should check is the version of your JVM. If you have different versions you may be running into some bug/feature which was fixed/implemented between the versions.
If that's not the problem, try to create a simple test case which exhibits the behavior and post it.


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

Joined: Sep 25, 2004
Posts: 156

I found the same problem.

I am working on linux but my JVM was different in Win98.

When i installed the same jdk as was in linux, it work out.

ANAND KARIA


Love is GOD and GOD is Love.
Anand Karia
IT Concretor.......
M/s. Anand Karia Concreting IT
juliane gross
Ranch Hand

Joined: May 30, 2002
Posts: 161
Thank you for your suggestions, Joe and Anand.

Meanwhile I found out the cause (I post it for everybody else
encountering a similar feature):

I had set the screen size explicitly (as opposed to using frame.pack())
and also used the method BorderFactory.createEmptyBorder() with
fixed numbers (for distance from top, left, bottom, right) for some
gui elements.

On a screen having height=1024, width=1280 the gui looks fine,
but on a screen having height=768 and width=1024 my buttons got
invisible because of the fixed createEmptyBorder: the
given numbers were too high on a smaller screen.

(By the way: this is how to find out the user's screen size


Using frame.pack() made the buttons visible again, or,
using different numbers for creating empty borders for
different screen sizes.
(How to solve this in a elegant way is a different chapter, though)
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Swing Buttons visible in Linux but not Windows