• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

The dialog won't be centered?

 
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

It goes to a little bit right hand side of the screen
Any ideas?
Tanks
Jack
 
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
 
Bartender
Posts: 5167
11
Netbeans IDE Opera Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
While steLocationRelativeTo(null) is the corrrect and accepted way to center a window on the screen, the posted code shouldn't result in a window that

goes to a little bit right hand side of the screen



Either initComponents() is changing the width of the dialog or the monitor isn't correctly calibrated.
 
Jacky Luk
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Darryl Burke wrote:While steLocationRelativeTo(null) is the corrrect and accepted way to center a window on the screen, the posted code shouldn't result in a window that

goes to a little bit right hand side of the screen



Either initComponents() is changing the width of the dialog or the monitor isn't correctly calibrated.



Hi Darryl,
I found the bug, it was because the initComponents() should be called before setLocation
Thanks
Jack
 
reply
    Bookmark Topic Watch Topic
  • New Topic