Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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: 23451
46
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: 2887
17
  • 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: 58395
178
  • 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.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!