Quiz Flashcards
Base Class of Java?
Object
Swing Classes in Unit 2
JFrame, JPanel
Describe Public and Private. What are they?
Public and Private are access modifiers. Public allows fields or methods to be accessed outside of the class in which it is defined. Private fields and methods only can be accessed inside the class it is defined.
Write statement you would call to include all of the swing classes to code.
Import Javax.swing*;
Which JPannel method gets called when the screen is repainted?
Paintcomponent
What are the data that belong to class or object called?
fields
What are code that implements the behavior of an object?
methods
What arguments fillRect or fillOval
start x, end x, width, height.
what are arguments of draw line method?
start x, start y, end x, end y
How do you set the current color of the graphic context?
g.SetColor(Color)
How do you define a Panel?
JPannel myPanel = new JPanel();
How do you set a size to panel?
myPanel.setSize(600, 400)
Where is the +x and +y plane?
Quadrant 4
How do you set color?
g.setcolor(color.green);