review_6 awt, swing, actionlistener, and graphics

28
Review_6 AWT, Swing, ActionListen er, and Graphics

Upload: maryann-gardner

Post on 19-Jan-2016

227 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Review_6 AWT, Swing, ActionListener, and Graphics

Review_6

AWT, Swing,ActionListen

er,and

Graphics

Page 2: Review_6 AWT, Swing, ActionListener, and Graphics

What is javax.swing?

Page 3: Review_6 AWT, Swing, ActionListener, and Graphics

If we make a JFrame, what code

do we need to make it show up?

Page 4: Review_6 AWT, Swing, ActionListener, and Graphics

How do we put a JPanel into a

JFrame?

Page 5: Review_6 AWT, Swing, ActionListener, and Graphics

If we do not specify a JFrame to do

EXIT_ON_CLOSE, what happens?

Page 6: Review_6 AWT, Swing, ActionListener, and Graphics

What are JButton and JCheckbox?

Page 7: Review_6 AWT, Swing, ActionListener, and Graphics

How do we set the color to red

in the paintComponent

method?

Page 8: Review_6 AWT, Swing, ActionListener, and Graphics

If we set a JLabel to have a background color, what else do

we need to do to see the color?

Page 9: Review_6 AWT, Swing, ActionListener, and Graphics

How do we change this label to write something

else?

JLabel display = new Jlabel();

Page 10: Review_6 AWT, Swing, ActionListener, and Graphics

In Java, layouts are handled by objects called…

Page 11: Review_6 AWT, Swing, ActionListener, and Graphics

Which layout is the best for quick GUI

design and automatically reacts

to resizing?

Page 12: Review_6 AWT, Swing, ActionListener, and Graphics

Which layout is the best for grouping

and placing components at the center or sides of

your frame?

Page 13: Review_6 AWT, Swing, ActionListener, and Graphics

Which layout is the best for placing all of your components

manually?

Page 14: Review_6 AWT, Swing, ActionListener, and Graphics

Which layout is the best for

automatically placing components

into rows and columns?

Page 15: Review_6 AWT, Swing, ActionListener, and Graphics

What is it called when we put panels with layouts inside

panels with layouts?

Page 16: Review_6 AWT, Swing, ActionListener, and Graphics

What is ActionListener?

Page 17: Review_6 AWT, Swing, ActionListener, and Graphics

What method does the

ActionListener interface have?

Page 18: Review_6 AWT, Swing, ActionListener, and Graphics

Fill in the blank to use

actionlisteners:

public class MyListener ________ ActionListener

Page 19: Review_6 AWT, Swing, ActionListener, and Graphics

What import do we need to use

ActionListeners?

Page 20: Review_6 AWT, Swing, ActionListener, and Graphics

In the following code, what is goes in the

blank?

button.addActionListener(____);

Page 21: Review_6 AWT, Swing, ActionListener, and Graphics

What goes in the blank?

public void actionPerformed(___) {

Page 22: Review_6 AWT, Swing, ActionListener, and Graphics

What code do we use to figure out which button was

clicked?

Page 23: Review_6 AWT, Swing, ActionListener, and Graphics

To paint inside of a JPanel, we first need to make a class that extends Jpanel and

overrides the....

Page 24: Review_6 AWT, Swing, ActionListener, and Graphics

What keyword can we use to refer to the

parent class?

Page 25: Review_6 AWT, Swing, ActionListener, and Graphics

If we want our graphics to resize

with the frame, what methods do we need?

Page 26: Review_6 AWT, Swing, ActionListener, and Graphics

If we want to draw the outline of a circle,

what method should we use?

Page 27: Review_6 AWT, Swing, ActionListener, and Graphics

If we want to draw a filled in rectangle

what method should we use?

Page 28: Review_6 AWT, Swing, ActionListener, and Graphics

The drawPolygon method takes in what

three parameters?