Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Ryan Anderson   on Sep 04 In Java Category.

  
Question Answered By: Orville Rodriguez   on Sep 04

Override paint method and then set background  color inside it.
The code looks like this:

@Override
public void paint(Graphics g) {
super(g);
Graphics2D g2d = (Graphics2D) g;// optional but useful
...
this.setBackground(Color.RED); //or whatever you prefer
...
}

I hope it will help.

Share: