13. Graphical user interfaces Flashcards
If A extends B, do instances of A have the properties of those of B, plus more, or vice versa?
ss
When does the main thread end? When does the virtual machine exit?
ss
What does the GUI event thread usually spend most of its time doing?
ss
How does event driven programming differ from the style used in the main method?
ss
What sort of information is held in ActionEvent objects?
ss
What is returned by getSource() method?
ss
What is the purpose of the Container class?
ss
What argument is given to Container: add() method?
ss
How to we specify the constraint in the Container: add() method?
ss
What kind of argument does Container: setLayout() have?
ss
How do we specify the label when we create a JButton?
ss
What type is the parameter in the JButton: addActionListener() method?
ss
What type is the method argument in JButton: setEnabled() method?
ss
What type is the method argument in JButton: setText() method?
ss
What part of a GUI does javax.swing.JFrame correspond to?
ss
Where does the given title typically appear (when using JFrame: setTitle() method)?
ss
What is the return type of the JFrame: getContentPane() method?
ss
What four choices do we have as arguments to the JFrame: setDefaultCloseOperation() method?
ss
When should JFrame: pack() method be called and what does it do?
ss
What type of argument is given to the JFrame: setVisible() method?
A boolean type
What is the purpose of the JLabel class?
ss
What type is the method parameter in the JLabel: setText() method?
ss
What arguments can we give to the constructor when using JTextArea?
ss
What happens if the given String contains new line characters in the JTextArea: setText() method?
ss
What is the difference between JTextArea: append() and JTextArea: setText()?
ss
What does 20 mean in new JTextField(20);
ss
What method arguments does JTextField: getText() method have?
ss
What type is the method argument of the JTextField: setText() method?
ss
What type is the method argument of the JTextField: setEnabled() method?
ss
How do we specify the initial value in JTextField?
ss
What does a layout manager do to what things within what other thing?
ss
In what pattern does LayoutManager: FlowLayout make the components appear, and in what order?
ss
Name three alignment modes for FlowLayout.
ss
In what pattern does LayoutManager: GridLayout make the components appear, and in what order?
ss
How many positions does LayoutManager: BorderLayout have, and what are their names?
ss
How do we link a listener object to an event source object?
ss
How many method bodies are contained in the ActionListener interface?
ss
What type of method argument does actionPerformed() method take?
ss
What does JPanel contain?
ss
How do we use the JScrollPane class?
ss
If A implements B, does A have definitions of the methods in B, or vice versa?
ss
What does AWT stand for? Which is newer AWT or Swing?
ss
What is the return type of currentTimeMillis() method?
A long type.