How to get string from JTextField and save it in variable?
问题 I am making a simple kid game that will ask the user to enter his/her name in a JTextField and that name will shown in other class after ending the game. I made new object and used it to call the method getName but when I call the method it return null I want it to return the name that the user entered. This is the code: package learn_englishTest; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Container; import java.awt.Dimension; import java.awt.Font; import java.awt