File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree File renamed without changes.
Original file line number Diff line number Diff line change 33import java .awt .Cursor ;
44import java .awt .Dimension ;
55import java .awt .Font ;
6+ import java .awt .Graphics ;
67import java .awt .GridLayout ;
78import java .awt .Image ;
89import java .awt .event .ActionEvent ;
@@ -41,7 +42,7 @@ public GamePanel(Game game) {
4142 RANGE_NUMBER = randomNumber .GET_RANGE_NUMBER ();
4243
4344 this .game = game ;
44- this .setBackground (ColorScheme .indigo );
45+ // this.setBackground(ColorScheme.indigo);
4546
4647 SCORE = database .showScore ();
4748 HIGH_SCORE = database .showHighScore ();
@@ -395,4 +396,20 @@ private void changeStatusValue(
395396 );
396397 }
397398 }
399+
400+ @ Override
401+ protected void paintComponent (Graphics g ) {
402+ super .paintComponent (g );
403+ g .drawImage (
404+ new ImageIcon (
405+ getClass ().getClassLoader ().getResource ("asset/background_game.png" )
406+ )
407+ .getImage (),
408+ 0 ,
409+ 0 ,
410+ getWidth (),
411+ getHeight (),
412+ null
413+ );
414+ }
398415}
Original file line number Diff line number Diff line change @@ -92,7 +92,7 @@ protected void paintComponent(Graphics g) {
9292 super .paintComponent (g );
9393 g .drawImage (
9494 new ImageIcon (
95- getClass ().getClassLoader ().getResource ("asset/background .png" )
95+ getClass ().getClassLoader ().getResource ("asset/background_menu .png" )
9696 )
9797 .getImage (),
9898 0 ,
You can’t perform that action at this time.
0 commit comments