Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

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: 23706
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: 2941
19
  • 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: 60127
188
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!