简体   繁体   English

当对象交互时,位于其他面板顶部的Jpanels消失。 -Java swing接口

[英]Jpanels on top of other panels, disappear when objects interact. - java swing interface

OK, I hope to explain this the best I can. 好的,我希望能尽我所能解释。

What's up is that I have an outer JPanel with a board game image, and an inner JPanel with the location menus, next turn, roll dice buttons etc. 问题是我有一个带有棋盘游戏图像的外部JPanel ,一个带有位置菜单,下一轮,掷骰子按钮等的内部JPanel

I make my board markers move from one side of the board to the other, but the inside parts of the board disapear as this happens. 我使板标记从板的一侧移到另一侧,但是在这种情况下,板的内部消失了。

I tried doing revalidate(); 我试着做revalidate(); repaint(); and everything for the outer, and inner panels, the board image, also buttons etc, but I'm still faced with this problem. 以及外部,内部面板,面板图像,按钮等的所有内容,但我仍然面临着这个问题。

Hope someone can help. 希望有人能帮忙。 Thanks. 谢谢。

Looks like OP may have abandoned this, but I'll take a complete shot in the dark: try turning off the optimizedDrawingEnabled flag on one (or both?) of the containers. 看起来OP可能已经放弃了这一点,但是我将在黑暗中进行全面拍摄:尝试关闭其中一个(或两个?)容器上的optimizedDrawingEnabled标志。 Swing expects that siblings never overlap - if they do, you need to turn off that flag. Swing希望兄弟姐妹永远不会重叠-如果兄弟姐妹重叠,则需要关闭该标志。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM