GObjects

GObjects - The GObject Hierarchy The classes that represent...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
1 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 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 ) Moves the object on the screen by adding dx and dy to its current coordinates. The following operations apply to all GObject s: 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 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 1
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/12/2010 for the course CS 106A at Stanford.

Ask a homework question - tutors are online