Results 1 to 5 of 5
  1. #1
    amolbirhade is offline Member
    Join Date
    Mar 2012
    Location
    Pune
    Posts
    3
    Rep Power
    0

    Unhappy Problem With JFrame for multiple screen resolutions

    i am using JFrame and designing it on 1366X700 resolution screen.
    and the problem is that if i add any component with bounds (600,200,200,25)
    when i run this jframe on another small resolution screen(800X600) then the component is go out of jframe.
    plz give me the solution for this problem.

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default Re: Problem With JFrame for multiple screen resolutions

    Solution: don't set the sizes or bounds of any components. Instead use appropriate layout managers and let the components and their containers, including the JFrame or any top-level window, find their preferred size by calling pack() on the top level window after adding all components.

  3. #3
    amolbirhade is offline Member
    Join Date
    Mar 2012
    Location
    Pune
    Posts
    3
    Rep Power
    0

    Default Re: Problem With JFrame for multiple screen resolutions

    Quote Originally Posted by Fubarable View Post
    Solution: don't set the sizes or bounds of any components. Instead use appropriate layout managers and let the components and their containers, including the JFrame or any top-level window, find their preferred size by calling pack() on the top level window after adding all components.
    thank you.
    will you please give any example in which pack() method is used.

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,315
    Blog Entries
    1
    Rep Power
    26

    Default Re: Problem With JFrame for multiple screen resolutions

    Quote Originally Posted by amolbirhade View Post
    thank you.
    will you please give any example in which pack() method is used.
    There are many examples of this in this forum if you search. Also check out the Swing layout manager tutorials.

  5. #5
    amolbirhade is offline Member
    Join Date
    Mar 2012
    Location
    Pune
    Posts
    3
    Rep Power
    0

    Default Re: Problem With JFrame for multiple screen resolutions

    thanks..
    thank you so much.

Similar Threads

  1. Replies: 15
    Last Post: 03-01-2012, 01:21 PM
  2. Some parts of JFrame off screen
    By cwbr in forum AWT / Swing
    Replies: 9
    Last Post: 01-30-2012, 06:40 PM
  3. Location Issue on multiple screen
    By ksaxena in forum AWT / Swing
    Replies: 0
    Last Post: 06-08-2010, 10:52 AM
  4. Replies: 1
    Last Post: 04-26-2010, 02:02 PM
  5. JFrame at Center Screen
    By hiranya in forum AWT / Swing
    Replies: 8
    Last Post: 02-11-2010, 05:29 PM

Tags for this Thread

Posting Permissions

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