Basic Program Flashcards

1
Q

JFrame

A

Window that contains a title/border. It is used to display graphics.

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

Double-Buffering

A

The act of drawing graphics off-screen (back buffer) and then copying the data to the main display (primary surface).

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

block line transfer (blitting)

A

The process of copying contents from the back buffer to the primary surface.

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

Page flipping

A

The act of alternating the value of the video pointer containing the video data to be drawn between the back buffer and the primary surface.

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

Abstract Window Toolkit (AWT)

A

Java’s original platform-dependent windowing, graphics, user-interface widget toolkit.

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

Swing

A

Java’s new GUI widget toolkit -> As it is written entirely in java, it is platform independent and aims to provide a more sophisticated control over graphics than the AWT.

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

Canvas

A

Class used to draw to the screen. A subclass that extends from canvas must be added to the JFrame using the add() method

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

Paint

A

void paint(graphics g) must be overridden, it is called when repaint() is called (generally from the main update method). super.paint() may be called to clear the canvas

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

Useful JFrame methods

A

add() -> used to add components like the canvas
addKeyListener()
pack() -> Sets components size
setVisible()
setPreferredSize(Dimension dim)
setDefaultCloseOperation(minimize/exit…)

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

KeyListener

A

A class can implement the KeyListener interface to override KeyPressed() / KeyReleased(). This class must be added to the JFrame using the addKeyListener() method

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