This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Hands On Software Engineering with Python and have Brian Allbey on-line!
See this thread for details.
Win a copy of Hands On Software Engineering with Python this week in the Jython/Python 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

Issue with Java Application Display  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Everyone,

I am having an issue with how Java applications are being displayed. I've noticed it on programs I am messing around with creating in swing but also mainly in polished applications such as "Sweet Home 3D". it's
appearing jumbled when I select menus or other objects. When I resize the application it's goes back to normal until I do it again. Any ideas?

I attached two examples, one with the issue and one how it should look.

i'm on windows 10 with the latest java / java jre/jdk installed.
issue.JPG
[Thumbnail for issue.JPG]
issue
normal.jpg
[Thumbnail for normal.jpg]
normal how it should look
 
Sheriff
Posts: 23962
50
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sayre, welcome to the Ranch!

I've heard that if you mix AWT components with Swing components, then changing the display (in the way you described) can lead to display problems of the type you described. I don't know if you did that but that would be my first idea.

And by the way I moved your post to the Swing forum, where it's less likely to get lost in the chatter.
 
Rancher
Posts: 2990
20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

When I resize the application it's goes back to normal



The layout manager is invoked when you resize the frame.

So maybe you are adding components dynamically and not invoking the layout manager by using revalidate() on the panel?

 
Marshal
Posts: 62144
193
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good point. As a general rule of thumb, call setVisible(true) once, but as the last line in your constructor/setUpGUI method, so all components have been added before the GUI is displayed.
 
Live a little! The night is young! And we have umbrellas in our drinks! This umbrella has a tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!