refresh JFrame after adding new Components

你说的曾经没有我的故事 提交于 2019-11-30 08:06:58
crusam

You have to revalidate(); the frame. If that doesn't work you also have to call repaint();

Call

revalidate();
repaint();

revalidate tells the layout manager to reset based on the new component list. This will also trigger a call to repaint.

repaint is used to tell a component to repaint itself.

in java repaint(); working for me. while revalidate(); not working for me.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!