O'Reilly logo

Graphic Java™ 1.2, Volume I: AWT, Third Edition by David M. Geary

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Component Properties

All components share a common set of properties that can be obtained and set after construction; the properties are listed in Table 11-2.

Table 11-2. java.awt.Component Properties Modifiable at Runtime
Property Set/Get Methods
Background Color void setBackground(Color) Color getBackground()
Bounds void setBounds(Rectangle)

void setBounds(int,int,int,int)

Rectangle getBounds()
Cursor void setCursor(Cursor) Cursor getCursor()
Drop Target void setDropTarget(DropTarget) DropTarget getDropTarget()
Enabled void setEnabled(boolean) boolean isEnabled()
Font void setFont(Font) Font getFont()
Foreground Color void setForeground(Color) Color getForeground()
Locale void setLocale(Locale) Locale getLocale()
Location void setLocation(Point) ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required