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();
}
}
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();
}
}
Comments
Leave a comment