Podcast
Questions and Answers
Which Java Swing component is used to display text?
Which Java Swing component is used to display text?
- JPanel
- JButton
- JLabel (correct)
- JTextField
What is the method used in JFrame to set the title of the frame?
What is the method used in JFrame to set the title of the frame?
- add(Component comp)
- setVisible(Boolean e)
- setSize(width, height)
- setTitle(String a) (correct)
Which Java Swing container is commonly used to store a group of components?
Which Java Swing container is commonly used to store a group of components?
- JButton
- JPanel (correct)
- JFrame
- JLabel
What does the method setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE) do in JFrame?
What does the method setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE) do in JFrame?
Which Java Swing component allows user input?
Which Java Swing component allows user input?
What is the purpose of Java Swing?
What is the purpose of Java Swing?
Which method is used to set the text on a Java JLabel?
Which method is used to set the text on a Java JLabel?
What method is used to enable or disable a Java JButton?
What method is used to enable or disable a Java JButton?
Which method in JLabel is used to get the currently set image/icon?
Which method in JLabel is used to get the currently set image/icon?
In Java Swing, which method is used to add an action listener to a JButton?
In Java Swing, which method is used to add an action listener to a JButton?
What does setVerticalAlignment(SwingConstants.) allow you to control in a Java JLabel?
What does setVerticalAlignment(SwingConstants.) allow you to control in a Java JLabel?
Which Java Swing component allows the editing of a single line of text?
Which Java Swing component allows the editing of a single line of text?