Well, I need help, how do you set the background of a JFrame?
import javax.swing.JFrame;
import java.awt.Graphics;
import java.awt.Color;
public class Form extends JFrame {
public Form() {
super("Helo homies!");
this.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
this.setSize(300, 300);
this.setVisible(true);
setBackground(Color.BLACK);
}
public void paint(Graphics g){
g.setColor(Color.BLACK);
g.fillRect(0, 0, getWidth, getHeight);
g.setColor(Color.RED);
g.drawLine(10, 0, 200, 20);
}
}
I'm trying to have a black background, and a red line.
The black background shows up, untill i start re-sizing.
then it reverts tot he defult grey-ish color.
Anyone have suggestions?
~-~(HDX)~-~