Java swing 中的 JButton
有没有办法通过代码检查按钮是否启用设置为 true 或 false?
Is there a way to check whether a button is enabled is set to true or false through code?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
布尔启用 = 按钮。isEnabled()
boolean enabled = button.isEnabled()
以防万一您不知道,Sun 已将其 Java 类的所有文档放在 在线。如果您对 Java SDK 类有疑问,这应该是您的第一站。有关 JButton 的文档。显然也欢迎您在这里提问:)
Just in case you are not aware of it Sun has put all the documentation for their Java classes online. This should be your first port of call for questions on the Java SDK classes. For documentation on JButton. You are obviously welcome to ask questions here as well :)