Question: Write a Java program that displays a frame window 300 pixels wide and 200 pixels high with the title My First Frame. Place the frame

Write a Java program that displays a frame window 300 pixels wide and 200 pixels high with the title My First Frame. Place the frame so that its top left corner is at a position 50 pixels from the top of the screen and 100 pixels from the left of the screen. To position a window at a specified location, you use the setLocation method, as in //assume mainWindow is declared and created frame.setLocation( 50, 50 ); 

Through experimentation, determine how the two arguments in the setLocation method affect the positioning of the window. 

//assume mainWindow is declared and created frame.setLocation( 50, 50 );

Step by Step Solution

3.48 Rating (155 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

import javaxswing class jframe public static ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Operating System Questions!