• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Swing Buttons visible in Linux but not Windows

 
juliane gross
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9312
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Anand Karia
Ranch Hand
Posts: 156
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
juliane gross
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic