This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

display interframe at centre  RSS feed

 
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
Sheriff
Posts: 53756
127
  • 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.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!