文档介绍:ponent类的常用方法
组件的颜色
、blue、green、orange、cyan、yellow、pink等静态常量。
1、public void setBackground(Color c)设置组件的背景颜色。
2、public void setForeground(Color c)设置组件的前景颜色。
3、public void getBackground(Color c)获取组件的背景颜色。
4、public void getForeground(Color c)获取组件的前景颜色。
组件的字体
Font类
1、public Font (String name,int style,int size)创建字体对象。 Style决定字体样式,(粗体)、Font. ITALIC(斜体)等 Font. PLAIN。 size决定字体大小,单位是磅,如12就是5号字。
2、public void setFont(Font f)设置组件的字体。
3、public void getFont (Font f)获取组件的字体。
1、public void setSize(int width,int height)设置组件的大小(宽度和高度)。
2、public void setLocation(int x,int y)设置组件在容器中的位置。
3、public Dimension getSize()返回Dimension对象的引用(组件的宽度和高度)。
4、public Point getLocation()返回Point对象的引用(组件在容器中的位置)。
5、public