Java Swing Flashcards

(45 cards)

1
Q

What kind of structure is Swing written in?

A

Container

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

What is Swing?

A

A GUI Widget Toolkit

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

What is AWT?

A

Abstract Window toolkit

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

Weight of AWT vs Swing?

A

Heavy vs Light-weight

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

Look and feel of AWT vs Swing?

A

Native vs Pluggable

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

MVC support for AWT vs Swing?

A

no support vs support

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

Component platform dependence AWT vs Swing

A

platform dependent vs. platform independence

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

Packages AWT vs. Swing

A

java.awt package vs javax.swing

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

Speed AWT vs Swing

A

Slower vs Faster

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

Event-Driven Programs

A

Some objects generate events and other objects respond to them

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

What kind of pattern is a Menu?

A

Composite, Menu made up of menu items

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

Absolute Layout

A

Graph Paper approach have to put everything on with coordinates

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

Example of Absolute Layout

A

Null Layout

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

Relative Layout

A

Components positioned relative to each other rather than absolute. Also field expands buttons and fields adjust location

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

Pros and Con of Relative Layout

A

pro- better than absolute

con - fairly inflexible

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

Example of Relative Layout

A

Flow Layout

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

Template Layout

A

Divide the container into sections and place one component in each section

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

Pros and Cons of Template Layout

A

Pro - easy to use

Con - the right template may not exist

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

Examples of Template Layout (3)

A

Grid Layout
Box Layout
Border Layout

20
Q

Box Layout

A

One row or column only

21
Q

Struct

A

One dimensional filler that is fixed

22
Q

Rigid Areas

A

2 dimensional filler fixed

23
Q

Glue

A

1 dimensional filler, variable in size

24
Q

Border Layout

A

North south east west center

25
Example of event generators
Mouse clicks, timing signals, key presses
26
Event Generators
classes that can generate events of different kids
27
Event Receivers
Classes that respond to events of different kinds
28
Discribe the event design
An event is generated by an EventGenerator, then the event is posted to the EventQueue, finally, the EventReceiver will respond to the event once the EventQuenue fires it to the reciever
29
Event Queue responsibility
It is a central repository of events that ensures that everything happens in the right order
30
Event Dispatch Thread
Events dispatched here, can call invokeAnWait, or invoke Later
31
JButton
implemenets ActionListener | actionPreformed()
32
JCheckBox
Can select multiple items | ItemListener
33
JRadioButton
ButtonGroup deselects box when new one is selected | ItemListener
34
TextComponenets
DocumentEvent responds to changes in model | actionEvent when enter is pressed
35
Examples of TextComponenets
JTextField | JTextArea
36
JList
No support of scrolling Lists things you can click on ListSelectionListener
37
JComboBox
Combo of JTextField and JList Item or ActionLIstener can select but from a drop down, and can also type in new responses
38
JSlider
ChangeEvent ChangeListener stateChanged
39
Hierarchical Template Layout
subdivide sections in a template layout using a Composite pattern
40
Pros and cons of Hierarchial Template Layout
Pro - platform independent and flexible | Con - difficult to get used to
41
Scrollable Componenets
Controls how much can see from the viewport
42
Docking Toolbars
Container that can be responsitioned, JToolBar
43
Borders
Visually group components, created using BorderFactory
44
Constrained Template Layout
Add constraints to any template | GridBagLayout
45
Layered Layout
Different layouts on top of each other