Search:

Type: Posts; User: Blackbird

Search: Search took 0.08 seconds.

  1. Replies
    14
    Views
    4,941

    Re: Place form in center of screen

    Okay, one of the replies here gave me a clue: I had to move the code in question AFTER the "setSize()" for it to work. Now the sun is shining, the birds are singing again, &c.

    ...
  2. Replies
    14
    Views
    4,941

    Re: Place form in center of screen

    I guess I'm new enough that I don't understand the question, so I'll just provide the entire class:
  3. Replies
    14
    Views
    4,941

    Re: Place form in center of screen

    It is in "go":

    ...
  4. Replies
    14
    Views
    4,941

    Re: Place form in center of screen

    By "getX()" I meant getWidth() and getHeight().

    The code snippet above won't compile; I get,
    (and similar err msgs for getWidth() and setLocation().

    I also tried this:
    ...
  5. Replies
    14
    Views
    4,941

    Re: Place form in center of screen

    I found this on a similar thread:

    Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
    int left = (d.width - this.getWidth()) / 2;
    int top = (d.height - this.getHeight()) /...
  6. Replies
    14
    Views
    4,941

    Place form in center of screen

    My form is wedged against the NW corner of my screen; I want it in the middle. In fact, I will always want the main form (in every project) in the middle. How can I make that the default behavior?
Results 1 to 6 of 6