code in a window

Posted on 2005-04-26
Last Modified: 2010-03-31

I need to Specify the size of the window(called "myWin") to

be 450 pixels wide by 375 pixels in depth

then cause the window's upper Left hand corner to appear at (50,75)

then cause the window to appear on the screen   and then have JAVA terminate execution when the application is closed.
Question by:usumle
    1 Comment
    LVL 15

    Accepted Solution

    JFrame frame = new JFrame(); // add your elements to the frame

    frame.setBounds(50, 75, 450, 375); // Since java 1.5 see:, int, int, int)

    or instead do:
    frame.setLocation(50, 75);
    frame.setSize(450, 375);

     // see

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
    Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
    This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now