GUIs Flashcards

1
Q

What does MVC stand for?

A

Model-View-Controller

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is each part of the MVC?

A

Model - How information is represented internally
View - How information is presented externally
Controller - User input

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What part of MVC does Java method calls fit into?

A

Model

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What part of MVC do mouse or keyboard events fit into?

A

Controller

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What part of MVC does the outward appearance of a program fit into?

A

View

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What does GUI stand for?

A

Graphical User Interface

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What does WIMP stand for?

A

Windows, Icons, Menus, Pointers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are modern GUI libraries usually called?

A

Toolkits

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What do modern GUI libraries usually contain?

A

Widgets

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are some examples of widgets?

A

Buttons, Sliders, Menus

Containers which give structure to the GUI

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are the 2 java GUI libraries?

A

java. awt (abstract windowing toolkit)

javax. swing (swing library)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How do swing components distinguish themselves from awt components?

A

They have “J” in front of them (e.g. JList, JMenu)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is a JFrame?

A

A window for a GUI in java

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How do you create a JFrame object?

A

JFrame frameName = new JFrame(“frame name”);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are the 4 options for setDefaultCloseOperation on a JFrame?

A

DO_NOTHING_ON_CLOSE
HIDE_ON_CLOSE (the default)
DISPOSE_ON_CLOSE (usually best for non-main frame)
EXIT_ON_CLOSE (implemented directly in JFrame and should usually only be done for the main frame)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are each of the 4 parameters for in setBounds(a,b,c,d) (method for a JFrame)

A

All parameters are integers.
a and b set position like x-y co-ordinate
c and d set width and height respectively

17
Q

What is another sizing method for a JFrame as an alternative to setBounds?

A

pack()

This will size the frame to fit the components within it

18
Q

What does the setVisible() method do and what parameter does it take?

A

setVisible takes a boolean value and makes the frame visible or not visible

19
Q

What are some common components used to populate a JFrame window?

A

JLabel
JButton
JTextField - one line of editable text
JTextArea - multiple lines of editable text
JCheckbox
JRadioButton - usually part of a ButtonGroup
JComboBox

20
Q

What is an event?

A

an event is an object created whenever something happens

21
Q

Where do events come from?

A

They are created by a source (usually a widget) and the type of event represents what has happened (e.g. button press, mouse move)

22
Q

How are events used?

A

They are ignored or interpreted by listeners