开发者

JFrame Components To Update Help (Java)

开发者 https://www.devze.com 2023-04-03 03:40 出处:网络
Alright. So I have a JFrame, and it has a JLabel. I call the JFrame, and it displays properly (with 开发者_Go百科the label). So now I want to call an updater to \"update\" the JFrame to add more butto

Alright. So I have a JFrame, and it has a JLabel. I call the JFrame, and it displays properly (with 开发者_Go百科the label). So now I want to call an updater to "update" the JFrame to add more buttons and crap. How can I do this WITHOUT having to open up a new JFrame?


You need to call JFrame.invalidate() first, then call JFrame.validate().

public void invalidate()

Invalidates the container. The container and all parents above it are marked as needing to be laid out.

0

精彩评论

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