April 17, 20223 yr Hello everyone. Stando here. I am looking for someone to assist me/give me a tutorial in allowing user input for a GUI. I would like this GUI to accept any monster id so the user will automatically attack the monster. I know how to do this with JCombobox, but not with JTextField. Would anyone with this sort of knowledge be able to assist me?
April 17, 20223 yr If you are not needing an entire GUI, you could use the JOptionPane class, it allows you to bring up a modal input dialog box with just one line of code. String monsterID = JOptionPane.showInputDialog("Please enter the monster ID.");
April 17, 20223 yr Author 7 hours ago, BravoTaco said: If you are not needing an entire GUI, you could use the JOptionPane class, it allows you to bring up a modal input dialog box with just one line of code. String monsterID = JOptionPane.showInputDialog("Please enter the monster ID."); Wow, this seems like a good idea. I am going to test this line and see how it looks within the GUI.
Create an account or sign in to comment