Results 1 to 5 of 5
  1. #1
    usha is offline Member
    Join Date
    Oct 2010
    Posts
    11
    Rep Power
    0

    Default How to set the JFrame to System resolution

    hi,
    i designed one Frame in one system with the dimensions 1152 x 860.If i run this application in another System( with dimensions 1024 X 768) this Frame application is not fitted to that system . To solve this i take the system dimensions using this method "Toolkit.getDefaultToolkit().getScreenSize()" and i set this dimension to Frame using "setPrefferedSize()" method.But its not solved.please help me.

    Thanks in advance,
    Usha.

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,874
    Rep Power
    8

    Default

    Why is it not solved? What does it do instead?

    You could just use setSize() instead of setPreferredSize().

    Or you could do it this way:
    Java Code:
    frame.setExtendedState(Frame.MAXIMIZED_BOTH);
    There are other ways as well. Google is your friend.

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

    Default

    Also, are your containers using appropriate layout managers? If the suggestions above don't help, then consider creating and posting an SSCCE

  4. #4
    usha is offline Member
    Join Date
    Oct 2010
    Posts
    11
    Rep Power
    0

    Default

    thanks kevinWorkman.
    Its working now.But i got another problem that Panels in the JFrame
    are not fitted.

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

    Default

    Quote Originally Posted by usha View Post
    thanks kevinWorkman.
    Its working now.But i got another problem that Panels in the JFrame
    are not fitted.
    Then please read my reply above, and then read the tutorials, starting here: Layout Tutorial

Similar Threads

  1. Resolution of the application
    By senorita2007 in forum New To Java
    Replies: 1
    Last Post: 04-08-2010, 04:30 AM
  2. Screen Resolution Problems
    By RicKaufman in forum AWT / Swing
    Replies: 1
    Last Post: 10-04-2009, 06:07 PM
  3. Resolution problem!
    By jan1ey in forum New To Java
    Replies: 1
    Last Post: 03-03-2009, 07:36 AM
  4. What's Your New Year's Resolution?
    By CaptainMorgan in forum Forum Lobby
    Replies: 4
    Last Post: 11-16-2008, 09:05 PM
  5. How to change the resolution ?
    By samson in forum Java 2D
    Replies: 1
    Last Post: 07-17-2007, 11:15 AM

Posting Permissions

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