开发者

Java Applet Panel Refresh

开发者 https://www.devze.com 2023-02-11 12:43 出处:网络
开发者_开发技巧I have a Java Applet that loads a record of a board game from a URL and displays the configuration using a series of panels laid out in a grid and nested in a JPanel. This is a small co

开发者_开发技巧I have a Java Applet that loads a record of a board game from a URL and displays the configuration using a series of panels laid out in a grid and nested in a JPanel. This is a small component of an overall applet with text fields and such for inputs and outputs. When a button is pressed, I want the board to show the next configuration from the record. I figured out a way to do this, but when the button is pressed, the same configuration is shown, but when I scroll up or down, or resize the window, then the configuration changes. Is there a way to "refresh" just the board JPanel when the button is pressed? Currently, when the button is pressed, the new configuration panel is created, the old configuration is removed, and the new configuration is added to the display.

Thank you very much!


If nothing else, you could try hiding and then immediately showing the panel again. That should force it to redraw.

0

精彩评论

暂无评论...
验证码 换一张
取 消