小编Chr*_*uze的帖子

Boolean not correctly updating unless you print it

So I am making this java applet and I just want to first make sure the key input works correctly before making it more complex. I have no idea why, but when you remove the "System.out.print(needUpdating);" it does not correctly moves the rectangle according to the key input. Could anyone tell me why and how to fix it? This is a total mystery to me.

import java.applet.Applet;
import java.awt.Graphics;
import java.awt.Rectangle;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;    
import javax.swing.JApplet;    

public class firstApplet …
Run Code Online (Sandbox Code Playgroud)

java applet swing boolean

0
推荐指数
1
解决办法
354
查看次数

标签 统计

applet ×1

boolean ×1

java ×1

swing ×1