I have been trying to develop a program that allows the user to enter their colour scheme preferences. I have run into trouble when trying to make the button itself and then assigning an image to that object just made. I have been trying to look up examples where this is done but everything I look at is slightly different to what I am trying to achieve. Any help on this great so thanks in advance. This is what I have been trying to do:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | import greenfoot.*; public class Mu_Main extends MuFe_ScreenFrame { /** * Constructor for objects of class Mu_Main. * */ public Mu_Main() { Bn_PlayGame PlayGame = new Bn_PlayGame(); switch (ColourScheme) { case 1 : PlayGame.setImage( new GreenfootImage( "Button PlayGame 1.png" )); break ; default : ColourScheme = 1 ; break ; } } } |