Win a copy of Secure Financial Transactions with Ansible, Terraform, and OpenSCAP this week in the Cloud/Virtualization forum!
  • 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 ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

AWT frame is not rendered as it should be in latest Java 8 version

Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A strange AWT bug (?) occurred when I upgraded to the latest Java 8 version, which is 1.8.0_271 according to the information given when I type java -version in the DOS box.

I have a class MainWindow in a package called gui, and the source looks like this:

The full code is available at

Now the "mainFrame" consists of a "drawingPanel" and a "controlPanel" as can be seen above. A flow layout is used to put these two panels from left to right and I use the pack() and setVisible() methods as they should be used.

Previously this produced the correct result, see the file old_java_version.jpg
But now I get a window (frame) which is just not large enough to contain the two panels it seems, see latest_java_version.jpg

The problem occurs on both Windows 7 and Windows 10.

Is this a bug?
Should I fix this?

Thanks so much,
[Thumbnail for old_java_version.jpg]
[Thumbnail for latest_java_version.jpg]
Posts: 72478
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Welcome to the Ranch

Why are you using AWT components? I thought they were obsolete. I also thought they are heavyweight components. so their rendering depends more on the OS than on the version of Java® you are using.
Are you okay? You look a little big. Maybe this tiny ad will help:
SKIP - a book about connecting industrious people with elderly land owners
    Bookmark Topic Watch Topic
  • New Topic