{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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 ).
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Ask a homework question - tutors are online