重新验证 JPanel 的父框架
当我显示/隐藏字段时,我希望我的面板适合框架。我如何通知父框架重新验证?
我考虑过将框架传递给面板的构造函数,但我认为可能有一种方法已经完成了。我记得 JPanel 中有一个 protected 属性,但没有..也许我记错了组件。
I want my panel to fit the frame when I show/hide fields. How could I notify to the parent frame to revalidate?
I thought about pass the frame to my panel's constructor, but I think may have a way this is already done. I remember that there was a protected attribute in JPanel, but there isn't.. maybe i remembering the wrong component.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您的意思是像摘要/详细信息视图一样,并且您希望更改框架大小?然后尝试:
You mean like a summary/details view and you want the frame size to change? Then try:
您可以将面板中的
addNotify
重写为某些内容:但不确定这是否是您的意思。
you could override the
addNotify
in the panel into something:Not sure if that's what you mean though.