mercredi 22 novembre 2017

if isBackgroundSet() gives errors and doesn't let me set Color

I am writing a code where I need the code to check if the panel's color is set to Yellow and if it is change the buttons color to another color. I am trying to do this but I keep getting an error. Here is the code...

        if(panelMenu.isBackgroundSet(Color.YELLOW)) {
        goBackMainMenuOpt.setBackground(Color.BLUE);
        exitButtonOpt.setBackground(Color.BLUE);
    }

so here where it says ....isBackgroundSet(Color.YELLOW)) on that line Eclipse suggests me to remove the argument Color.YELLOW. Why is this a problem and is there another way to check the background color and change a button's color?

Aucun commentaire:

Enregistrer un commentaire