如何从主函数到达 JButton
how to reach JButton from main function
我创建了一个名为 "okno" 的 window,其中我有一个名为 "tlcOdejit" 的 JButton,我想在从输入中读取一些文本时禁用该按钮。但是当我输入
okno.tlcOdejit.setEnabled(false);
编译器告诉我 "cannot find symbol -> tlcOdejit"。
我可以使用 JTextArea 的功能,例如
okno.textArea1.append(line);
在我的 textArea 中输入一行,但我无法通过这种方式到达按钮。你能告诉我,我做错了什么吗?
是tlcOdejit public吗?如果不是,那可能是问题所在。
我创建了一个名为 "okno" 的 window,其中我有一个名为 "tlcOdejit" 的 JButton,我想在从输入中读取一些文本时禁用该按钮。但是当我输入
okno.tlcOdejit.setEnabled(false);
编译器告诉我 "cannot find symbol -> tlcOdejit"。 我可以使用 JTextArea 的功能,例如
okno.textArea1.append(line);
在我的 textArea 中输入一行,但我无法通过这种方式到达按钮。你能告诉我,我做错了什么吗?
是tlcOdejit public吗?如果不是,那可能是问题所在。