I am trying to get my program to draw a black rectangle in a frame. The frame pops up, but there is no rectangle. Could someone de-bug my program and tell me what I need to do to fix it?
I used Eclipse to write the program, and there were no errors found.
Thanks in advance.
import java.awt.*;
import javax.swing.*;
public class Main1 extends JFrame
{
public Main1()
{
super("Paint");
setSize(1000,500);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
}
public static void Paint(Graphics g)
{
g.setColor(Color.black);
g.fillRect(0, 0, 1000, 500);
}
public static void main(String[] args)
{
@SuppressWarnings("unused")
Main1 thisOne=new Main1();
}
}