Java Swing Flashcards

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
Q

Example of event generators

A

Mouse clicks, timing signals, key presses

26
Q

Event Generators

A

classes that can generate events of different kids

27
Q

Event Receivers

A

Classes that respond to events of different kinds

28
Q

Discribe the event design

A

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
Q

Event Queue responsibility

A

It is a central repository of events that ensures that everything happens in the right order

30
Q

Event Dispatch Thread

A

Events dispatched here, can call invokeAnWait, or invoke Later

31
Q

JButton

A

implemenets ActionListener

actionPreformed()

32
Q

JCheckBox

A

Can select multiple items

ItemListener

33
Q

JRadioButton

A

ButtonGroup deselects box when new one is selected

ItemListener

34
Q

TextComponenets

A

DocumentEvent responds to changes in model

actionEvent when enter is pressed

35
Q

Examples of TextComponenets

A

JTextField

JTextArea

36
Q

JList

A

No support of scrolling
Lists things you can click on
ListSelectionListener

37
Q

JComboBox

A

Combo of JTextField and JList
Item or ActionLIstener
can select but from a drop down, and can also type in new responses

38
Q

JSlider

A

ChangeEvent
ChangeListener
stateChanged

39
Q

Hierarchical Template Layout

A

subdivide sections in a template layout using a Composite pattern

40
Q

Pros and cons of Hierarchial Template Layout

A

Pro - platform independent and flexible

Con - difficult to get used to

41
Q

Scrollable Componenets

A

Controls how much can see from the viewport

42
Q

Docking Toolbars

A

Container that can be responsitioned, JToolBar

43
Q

Borders

A

Visually group components, created using BorderFactory

44
Q

Constrained Template Layout

A

Add constraints to any template

GridBagLayout

45
Q

Layered Layout

A

Different layouts on top of each other