Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JDialog positioning  RSS feed

 
Vladas Razas
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I made my frame window and from it I create "About" JDialog. That About dialog pops positioned at the top left corner of the screen. I would like position it somewhere around center of my JFrame, of course. Is there anything I can use in Swing or I have to implement this myself?

Thanks
 
jefff willis
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try this

 
jefff willis
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry, there is a lot of extra imports at the top of that example that are unnecessary.

I did a little cutting-and-pasting to get that example to you.

You don't need them at all.
 
Vladas Razas
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!