swing - Displaying messge when pausing a game in java -


I have developed in Java

I have all the functionality like posing, resuming is. But my problem is now to display a message that prevents the game between "game penalty" between JFrame . I tried to apply the JLabel ImageIcon but failed. Please provide any help. Thanks in advance.

Public Class Nequalas applies the JFL keyListener {boolean for_pause; Private canvas canvas; // Variable declaration-finished public nuclides () {// frame section canvas initial = new drawbacks (); Canvas.setPreferredSize (new dimension (CANVAS_WIDTH, CANVAS_HEIGHT)); This.setContentPane (canvas); This.setDefaultCloseOperation (EXIT_ON_CLOSE); This.pack (); SetLocationRelativeTo (zero); This.setTitle ("bouncing ball"); This.setVisible (true); //this.setResizable (false); AddKeyListener (this); Draw_rect (); } ActionList Action = New Executioner () {@ Override Public Voice Action Crorded (ActionAge AE) {update}; Repaint (); }}; Timer t = new timer (8, action); Public Zero Update () {x + = xSpeed; Y + = ySpeed; If (x> CANVAS_WIDTH - size || x <0) {xSpeed ​​= -xSpeed; } If (y> CANVAS_HEIGHT - 80 || y

to display a message You can use it for


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -