简体   繁体   English

按钮和文本字段随机出现在小程序上 - java

[英]Buttons and textfields randomly appear on applet - java

I need to make a game as a assignment, but these textfields and buttons seem to randomly appear on top and bottom.我需要制作一个游戏作为作业,但这些文本字段和按钮似乎随机出现在顶部和底部。 This happends from start.这从一开始就发生了。 I've checked already if all buttons and textfields are positioned right.我已经检查过所有按钮和文本字段是否都正确定位。 Does anyone have a idea what could be causing this?有谁知道是什么导致了这种情况?

For any deeper look intro the code: Github Repo对于任何更深入的介绍代码: Github Repo

见上和下

Thanks in advance!提前致谢! :-) :-)

This was not an issue.这不是问题。 I simply have forgotten to use super on paintComponent ( i was thinking something was wrong with the actual buttons and textfields, or the order of them ).我只是忘记在paintComponent上使用super(我在想实际按钮和文本字段有问题,或者它们的顺序有问题)。

super.paintComponent(g) solved the issue. super.paintComponent(g)解决了这个问题。 How clumsy of me.我多么笨拙。

Thank you for all helpful responses!感谢所有有用的回复! Especially @MadProgrammer :)尤其是@MadProgrammer :)

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

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