我希望在输入输入并单击添加按钮后关闭窗口.我还想要一条消息,通知用户输入数据已保存.此代码链接到将存储输入的数据库对象.
public class Add extends JFrame
implements ActionListener {
/** {@link JTextField} where the user name is entered */
JTextField Inputusername = new JTextField(7);
/** {@link JTextField} where the user age is entered */
JTextField age = new JTextField(2);
/** {@link JTextField} where the user ID is entered */
JTextField inputuserid = new JTextField(4);
/** Add Client button */
JButton addnewclient = new JButton("Add Client");
/** male Jradiobutton */
JRadioButton male = new JRadioButton("Male");
/** female Jradiobutton */
JRadioButton female …Run Code Online (Sandbox Code Playgroud)