This week's book giveaway is in the HTML/CSS/JavaScript forum.
We're giving away four copies of Practical SVG and have Chris Coyier on-line!
See this thread for details.
Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

display interframe at centre

 
Carl John
Ranch Hand
Posts: 47
Eclipse IDE Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Please anyone help me to display the internal frame to the center of the desktop pane.


Thanks.
 
Campbell Ritchie
Marshal
Posts: 52664
121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there anything useful in the Java™ Tutorials? There seems to be a setLocation method, but that would require a bit of arithmetic to get your internal frame into the centre.
 
Avi Abrami
Ranch Hand
Posts: 1141
1
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Carl,
I suggest using method reshape in class JInternalFrame.
I created a java class to test that method and it looks like it does what you want.
Note however, that I invoke that method after displaying the GUI.

Good Luck,
Avi.
 
Message for you sir! I think it is a tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!