Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Material Type: Quiz; Professor: Padua-Perez; Class: OBJECT-ORIENTED PROG II; Subject: Computer Science; University: University of Maryland; Term: Unknown 1989;
Typology: Quizzes
1 / 1
public class GuiExample extends JPanel { public GuiExample() { JFrame frame = new JFrame("Example"); frame.setContentPane(this); // adds the panel JButton postButton = new JButton("Post"); add(postButton);
postButton.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent evt) { System. out .println("Posting message"); } }); frame.pack(); frame.setVisible(true); } }