06b-GObjects

06b-GObjects - The GObject Hierarchy The classes that...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
The GObject Hierarchy The classes that represent graphical objects form a hierarchy, part of which looks like this: GObject GRect GOval GLine GLabel Graphic courtesy of Eric Roberts
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Operations on the GObject Class object .setColor( color ) Sets the color of the object to the specified color constant. object .setLocation( x , y ) Changes the location of the object to the point ( x , y ). object .move( dx , dy ) The following operations apply to all GObject s: Moves the object on the screen by adding dx and dy to its current coordinates. The standard color names are defined in the java.awt package: Color.BLACK Color.DARK_GRAY Color.GRAY Color.LIGHT_GRAY Color.WHITE Color.RED Color.YELLOW Color.GREEN Color.CYAN Color.BLUE Color.MAGENTA Color.ORANGE Color.PINK Based on slides by Eric Roberts
Background image of page 2
Operations on the GLabel Class Constructor new GLabel( text , x , y ) Creates a label containing the specified text that begins at the point ( x , y ). Methods specific to the
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 08/24/2011 for the course CS 106A taught by Professor Sahami,m during the Spring '08 term at Stanford.

Page1 / 5

06b-GObjects - The GObject Hierarchy The classes that...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online