Results 1 to 9 of 9

Thread: Maximizing a JWindow?

  1. #1

    Thread Starter
    Addicted Member Virtual24's Avatar
    Join Date
    May 2001
    Posts
    228

    Maximizing a JWindow?

    Does anyone know how to maximize a JWindow through code?
    To protect time is to protect everything...

  2. #2
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    That is a good question. A JWindow is usually used to display somthing that needs to be in it's own window without the adornments added by a JFrame. You would have to move or close this window programmatically because of the absence of the close, min, and max buttons.

    I don't think that there is a way to maximize a JWindow from the window itself. You would have to provide an alternate button for the action and then scale the JWindow to the size of the screen.

  3. #3
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Scaling a window to the screen size is not the same as maximizing.

    But there seems to be no way of maximizing a JWindow. Why do you want to do it?
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  4. #4
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    Posted by CornedBee
    Scaling a window to the screen size is not the same as maximizing.
    Sure it is. Take Explorer when in full screen and click restore, the button changes to maximize. Click maximize and the window is scaled back to the screen size.

  5. #5
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    ???

    I don't use IE.

    Windows maintains an internal state of a window, including if it is maximized or not. This state is not changed when you just resize the window. It has a few effects, like that a maximized window can not be moved or resized.

    But since a JWindow doesn't have a title bar, a resizable frame or any buttons resizing to screen size has the same effect as maximizing. Only the same effect, mind you, from the perspective of Windows it's not the same.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  6. #6

    Thread Starter
    Addicted Member Virtual24's Avatar
    Join Date
    May 2001
    Posts
    228
    Well thats all I want is to "setSize" the JWindow, or JFrame to the size of the screen.
    To protect time is to protect everything...

  7. #7
    Hyperactive Member marnitzg's Avatar
    Join Date
    Oct 2000
    Location
    South Africa
    Posts
    372
    To get the size of the screen use this

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

  8. #8

    Thread Starter
    Addicted Member Virtual24's Avatar
    Join Date
    May 2001
    Posts
    228
    Well thank you, that works.
    To protect time is to protect everything...

  9. #9

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