2 Replies Latest reply: Oct 4, 2012 5:06 PM by Jörg RSS

    Adjustable window

    966086
      Hi,
      I am developing a desktop application using Swing. The application consists of a JFrame at the lower stack, then followed by a JPanel and many components e.g. Textbox, ComboBox, Label, etc. The size of each component has been set statically, and the Frame is set to 1200x768. The problem I have is when this app is run into a device which has smaller resolution, e.g. 1024x768, some part of the window is cut off. Is it possible to adjust the size according to the size of the device's resolution?

      Thanks.
      Henry
        • 1. Re: Adjustable window
          sabre150
          963083 wrote:The size of each component has been set statically, and the Frame is set to 1200x768.
          A fundamental mistake - you need to re-factor the application to use layout managers. It also sounds like you have too much on one screen so you may have to also re-factor to split it into two or more 'pages'.
          • 2. Re: Adjustable window
            Jörg
            ... and if you want to design your "pages" variable according to the screen in use, you can get its size with
            Toolkit.getScreenSize()