Im trying to get a GUI interface in java where there is four text fields for...

90.2K

Verified Solution

Question

Programming

Im trying to get a GUI interface in java where there is fourtext fields for the first name, last name, department, and phonenumber of employee in a program. Then also have a radio buttonbelow for Gender (Male/Female/Other) and a list for the Title(Mr./Ms./Mrs./Dr./Col./Prof.). At the very bottom of the framethere has to be buttons for printing, submitting and exiting butfor whatever reason when I tried it nothing appears in the frameregardless of what I do. I need help coding this its been a whilesince I've used GUI interface and I don't remember all of thesyntax anymore

Answer & Explanation Solved by verified expert
4.1 Ratings (860 Votes)
GUIjavaimport javaawtEventQueueimport javaxswingJFrameimport javaxswingJPanelimport javaxswingborderEmptyBorderimport javaawtGridLayoutimport javaxswingJTextAreaimport javaxswingJTextFieldimport javaxswingJRadioButtonimport javaxswingJListimport javaxswingButtonGroupimport javaxswingJButtonimport javaawteventActionListenerimport javaawteventActionEventpublic class GUI extends JFrame private JPanel contentPane private JPanel panel private JTextArea txtrLastName private JTextField textField private JTextArea txtrFirstName private JTextField textField1 private JTextArea txtrDepartment private JTextField textField2 private JTextArea txtrPhoneNumber private JTextField textField3 private final ButtonGroup buttonGroup newButtonGroup private Directory d new Directory Launch the application public static void mainString args EventQueueinvokeLaternewRunnable    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students