Answer to Question #201094 in Java | JSP | JSF for Hamza

Question #201094

Correct the syntax errors in the following program and add any additional statements necessary to make the program work:


import javax.jswing.*;

public class ROne extends JFrame

{

static private final int WIDTH = 400;

static private final int HEIGHT = 300;


public RectangleProgramOne()

{

setTitle("Welcome");

setSize(WIDTH,HEIGHT);

SetVisible(true);

setDefaultCloseOperation(EXIT_ON_CLOSE);

}

public static void main(String args[])

{

ROne r1 = r1();

}

}


1
Expert's answer
2021-05-31T05:39:02-0400
import javax.swing.*;


public class RectangleProgramOne extends JFrame{
	static private final int WIDTH = 400;
	static private final int HEIGHT = 300;
	public RectangleProgramOne(){
		setTitle("Welcome");
		setSize(WIDTH, HEIGHT);
		setVisible(true);
		setDefaultCloseOperation(EXIT_ON_CLOSE);
	}
	public static void main(String args[]){

		RectangleProgramOne r1 = new RectangleProgramOne();
	}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS