CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: java

  1. #1
    Join Date
    Jan 1999
    Posts
    1

    java



    hi,


    does anybody know how to position a JFrame-Window in a java APPLICATION?

    for example:

    center the window in the middle of the screen.


    thanks in advance


    werner hutmacher

  2. #2
    Join Date
    May 1999
    Posts
    93

    Re: java



    //Center frame

    Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();

    Dimension size = frame.getSize();

    screenSize.height = screenSize.height/2;

    screenSize.width = screenSize.width/2;

    size.height = size.height/2;

    size.width = size.width/2;

    int y = screenSize.height - size.height;

    int x = screenSize.width - size.width;

    frame.setLocation(x, y);



  3. #3
    Join Date
    Oct 1999
    Posts
    17

    Re: java

    use component.setLocaton(int x, int y)


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured