Set Background Color

+1 Hristijan Ilieski · November 17, 2014
I'am watching the 5th tutorial on the game development series in java, and bucky says to write setBackgroundColor(Color.PINK).. But my compiler says The method setBackgroundColor(Color) is undefined for the type bucky.. What could be the problem?

public void run(DisplayMode dm){
getContentPane().setBackground(Color.YELLOW);
this.setBackgroundColor(Color.PINK);
setForeground(Color.WHITE);
}

Post a Reply

Replies

Oldest  Newest  Rating
0 Tony Ibrahim · May 24, 2016
This is probably super late but I ran into this problem also and it was because I forget to extend my class using JFrame 

instead of:  public class bucky  {

use: public class bucky extends JFrame {

Hope this was helpful :)
  • 1

Java / Android Development

106,989 followers
About

Very popular language used to create desktop applications, website applets, and Android apps.

Links
Moderators
Bucky Roberts Administrator