how to customize and display the frame window at center of my screen in java swing? -


Hi, I'm developing a desktop application using swings when I'm executing that frame window On my left side is displayed on the screen, can I customize it and display it in the middle of the screen?

"yes i am using GUI builder"

Just setLocationRelativeTo (null) after initComponents () , in the manufacturer.

  extends myframe JFrame to the public class {public MyFrame () {initComponents (); SetLocationRelativeTo (zero); }}  

JFrame as the subclass of window get the window methods it occurs. The API can be seen The above method is listed as follows

  • - Sets the window's position relative to the specified component according to the following circumstances.
    If the component is tap, or the graphics configuration associated with this component is empty, the window is placed at the center of the screen.

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -