• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Swing Buttons visible in Linux but not Windows

 
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 158
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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)
 
Watchya got in that poodle gun? Anything for me? Or this tiny ad?
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic