Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: How to make my Program always run with dimensions 1350 x 650?

  1. #1
    Junior Member
    Join Date
    May 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How to make my Program always run with dimensions 1350 x 650?

    I created a great program on a wide screen laptop that has dimensions 1350 x 650. Throughout the entire program I have the Width = 1350 and Height = 650. When I try to run the program on a non-wide screen, everything gets squished and the whole thing is a mess.

    Is there a way to make it so the program ALWAYS has a width of 1350...and if the computer's monitor is not wide enough then the program's frame just goes off the screen?

    I have tried moving the program so half of it is off the screen and trying to drag its side to stretch it out to 1350, but it won't let me.

    I've been trying to find an answer to this problem forever and have not been successful...If you could just direct me to an article, I don't mind reading...however I've tried googling the idea...but have gotten no where.

    P.S. I am using setPreferredSize(...) for all my components...and they are all tied/related to the width and height.

    I am also using
    frame.pack();
    frame.show();
    where frame is my JFrame....
    Last edited by i3riank; May 28th, 2011 at 08:20 PM.


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: How to make my Program always run with dimensions 1350 x 650?

    Have you tried setSize()?

  3. #3
    Junior Member
    Join Date
    May 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: How to make my Program always run with dimensions 1350 x 650?

    Yes...i've tried setSize...setMinimumSize...setMaximumSize....it always lets me grab the edge and shrink it but I can never drag it larger...

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: How to make my Program always run with dimensions 1350 x 650?

    What size does the window get when you set it using setSize(1350, 650)?

    it always lets me grab the edge and shrink it but I can never drag it larger...
    Larger than what?

Similar Threads

  1. How to make a program quit?
    By copelandtml in forum Loops & Control Statements
    Replies: 6
    Last Post: February 16th, 2011, 01:10 AM
  2. how do i make my program to do......
    By andys in forum Object Oriented Programming
    Replies: 6
    Last Post: November 29th, 2010, 07:44 AM
  3. how do i make my program to....
    By andys in forum Object Oriented Programming
    Replies: 2
    Last Post: November 26th, 2010, 10:31 AM
  4. how to make a program take time...
    By DLH112 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: February 10th, 2010, 07:09 PM
  5. Creating a class for points in three dimensions.
    By joachim89 in forum What's Wrong With My Code?
    Replies: 4
    Last Post: January 8th, 2010, 07:13 PM