[英]Updating the GUI of a Java Applet
I'm writing a Java applet in Eclipse. 我在Eclipse中编写Java小程序。 When I click on the button in the applet, it should display a message, but the message won't actually show up until I fiddle with the applet window, like resizing the window.
当我单击小程序中的按钮时,它应该显示一条消息,但是直到我摆弄小程序窗口时才真正显示该消息,例如调整窗口大小。 Is there something I should add in my code, so the GUI automatically updates once I click the button?
我应该在代码中添加一些内容,以便单击按钮后GUI会自动更新吗?
generally a call to repaint() will take care of that. 通常,调用repaint()会解决这个问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.