Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在加载面板时从 aj Textfield 获取值?
从 JTextfield 获取值
String text = textField.getText();
您可以使用正常的方式:
txtField.getText();
读取内容,但如果您尝试在应用程序启动的第一次加载时执行此操作,则当时不会设置内容,除非在这种情况下它在“硬编码”代码中设置,否则可以读取它直接地。