Swing - Component 组件类
简介
Component 组件类是 AWT 的非菜单用户界面控件的抽象基类。 组件表示具有图形表示的对象。
类声明
以下是 java.awt.Component 类的声明 −
public abstract class Component
extends Object
implements ImageObserver, MenuContainer, Serializable
字段
以下是 java.awt.Component 类的字段 −
static float BOTTOM_ALIGNMENT − getAlignmentY 易于使用的常量。
static float CENTER_ALIGNMENT − getAlignmentY 和 getAlignmentX 的易用常量。
static float LEFT_ALIGNMENT − getAlignmentX 的易用常量。
static float RIGHT_ALIGNMENT − getAlignmentX 的易用常量。
static float TOP_ALIGNMENT − getAlignmentY() 的易用常量。
类构造函数
| S.No. | 构造函数 & 描述 |
|---|---|
| 1 |
protected Component() 这将创建一个新组件。 |
类方法
| 序号 | 方法 & 描述 |
|---|---|
| 1 |
boolean action(Event evt, Object what) 已弃用。 从 JDK 1.1 版开始,应该将此组件注册为触发动作事件的组件上的 ActionListener。 |
| 2 |
void add(PopupMenu popup) 将指定的弹出菜单添加到组件。 |
| 3 |
void addComponentListener(ComponentListener l) 添加指定的组件侦听器以接收来自该组件的组件事件。 |
| 4 |
void addFocusListener(FocusListener l) 当此组件获得输入焦点时,添加指定的焦点侦听器以接收来自此组件的焦点事件。 |
| 5 |
void addHierarchyBoundsListener(HierarchyBoundsListener l) 当该容器所属的层次结构发生变化时,添加指定的层次边界侦听器以接收来自该组件的层次边界事件。 |
| 6 |
void addHierarchyListener(HierarchyListener l) 当此容器所属的层次结构发生更改时,添加指定的层次结构侦听器以接收来自此组件的层次结构更改事件。 |
| 7 |
void addInputMethodListener(InputMethodListener l) 添加指定的输入法侦听器以接收来自该组件的输入法事件。 |
| 8 |
void addKeyListener(KeyListener l) 添加指定的按键侦听器以接收来自该组件的按键事件。 |
| 9 |
void addMouseListener(MouseListener l) 添加指定的鼠标侦听器以接收来自该组件的鼠标事件。 |
| 10 |
void addMouseMotionListener(MouseMotionListener l) 添加指定的鼠标运动侦听器以接收来自该组件的鼠标运动事件。 |
| 11 |
void addMouseWheelListener(MouseWheelListener l) 添加指定的鼠标滚轮侦听器以接收来自该组件的鼠标滚轮事件。 |
| 12 |
void addNotify() 通过将其连接到本机屏幕资源,使该组件可显示。 |
| 13 |
void addPropertyChangeListener(PropertyChangeListener listener) 将 PropertyChangeListener 添加到侦听器列表中。 |
| 14 |
void addPropertyChangeListener(String propertyName, PropertyChangeListener listener) 将 PropertyChangeListener 添加到特定属性的侦听器列表中。 |
| 15 |
void applyComponentOrientation(ComponentOrientation orientation) 设置此组件和其中包含的所有组件的 ComponentOrientation 属性。 |
| 16 |
boolean areFocusTraversalKeysSet(int id) 返回给定焦点遍历操作的焦点遍历键集是否已为此组件显式定义。 |
| 17 |
int checkImage(Image image, ImageObserver observer) 返回指定图像的屏幕表示的构造状态。 |
| 18 |
int checkImage(Image image,int width,int height, ImageObserver observer) 返回指定图像的屏幕表示的构造状态。 |
| 19 |
boolean contains(int x,int y) 检查此组件是否"包含"指定点,其中 x 和 y 被定义为相对于该组件的坐标系。 |
| 20 |
boolean contains(Point p) 检查此组件是否"包含"指定点,其中点的 x 和 y 坐标定义为相对于该组件的坐标系。 |
| 21 |
Image createImage(ImageProducer producer) 从指定的图像生成器创建图像。 |
| 22 |
Image createImage(int width,int height) 创建用于双缓冲的离屏可绘制图像。 |
| 23 |
VolatileImage createVolatileImage(int width,int height) 创建一个不稳定的屏幕外可绘制图像以用于双缓冲。 |
| 24 |
VolatileImage createVolatileImage(int width,int height, ImageCapabilities caps) 使用给定的功能创建一个不稳定的离屏可绘制图像。 |
| 25 |
void deliverEvent(Event e) 已弃用。 从 JDK 1.1 版本开始,由 dispatchEvent(AWTEvent e) 取代。 |
| 26 |
void disable() 已弃用。 从 JDK 版本 1.1 开始,由 setEnabled(boolean) 取代。 |
| 27 |
protected void disableEvents(long eventsToDisable) 禁止将指定事件掩码参数定义的事件传递给该组件。 |
| 28 |
void dispatchEvent(AWTEvent e) 向该组件或其子组件之一分派事件。 |
| 29 |
void doLayout() 提示布局管理器布局此组件。 |
| 30 |
void enable() 已弃用。 从 JDK 版本 1.1 开始,由 setEnabled(boolean) 取代。 |
| 31 |
void enable(boolean b) 已弃用。 从 JDK 版本 1.1 开始,由 setEnabled(boolean) 取代。 |
| 32 |
protected void enableEvents(long eventsToEnable) 允许将指定的事件掩码参数定义的事件传递给该组件。 |
| 33 |
void enableInputMethods(boolean enable) 启用或禁用此组件的输入法支持。 |
| 34 |
protected void firePropertyChange(String propertyName, boolean oldValue, boolean newValue) 支持报告布尔属性的绑定属性更改。 |
| 35 |
void firePropertyChange(String propertyName, byte oldValue, byte newValue) 报告绑定的属性更改。 |
| 36 |
void firePropertyChange(String propertyName, char oldValue, char newValue) 报告绑定的属性更改。 |
| 37 |
void firePropertyChange(String propertyName, double oldValue, double newValue) 报告绑定的属性更改。 |
| 38 |
void firePropertyChange(String propertyName, float oldValue, float newValue) 报告绑定的属性更改。 |
| 39 |
void firePropertyChange(String propertyName, long oldValue, long newValue) 报告绑定的属性更改。 |
| 40 |
protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) 支持报告对象属性的绑定属性更改。 |
| 41 |
void firePropertyChange(String propertyName, short oldValue, short newValue) 报告绑定的属性更改。 |
| 42 |
AccessibleContext getAccessibleContext() 获取与此组件关联的 AccessibleContext。 |
| 43 |
float getAlignmentX() 返回沿 x 轴的对齐方式。 |
| 44 |
float getAlignmentY() 返回沿 y 轴的对齐方式。 |
| 45 |
Color getBackground() 获取此组件的背景颜色。 |
| 46 |
int getBaseline(int width,int height) 返回基线。 |
| 47 |
Component.BaselineResizeBehavior getBaselineResizeBehavior() 返回一个枚举,指示组件的基线如何随着大小的变化而变化。 |
| 48 |
Rectangle getBounds() 以 Rectangle 对象的形式获取此组件的边界。 |
| 49 |
Rectangle getBounds(Rectangle rv) 将此组件的边界存储到"返回值"rv 中并返回 rv。 |
| 50 |
ColorModel getColorModel() 获取用于在输出设备上显示组件的 ColorModel 实例。 |
| 51 |
Component getComponentAt(int x,int y) 确定此组件或其直接子组件之一是否包含 (x, y) 位置,如果是,则返回包含组件。 |
| 52 |
Component getComponentAt(Point p) 返回包含指定点的组件或子组件。 |
| 53 |
ComponentListener[] getComponentListeners() 返回在此组件上注册的所有组件侦听器的数组。 |
| 54 |
ComponentOrientation getComponentOrientation() 检索用于对该组件中的元素或文本进行排序的语言敏感方向。 |
| 55 |
Cursor getCursor() 获取组件中设置的光标。 |
| 56 |
DropTarget getDropTarget() 获取与此 Component 关联的 DropTarget。 |
| 57 |
Container getFocusCycleRootAncestor() 返回 Container,它是该组件的焦点遍历循环的焦点循环根。 |
| 58 |
FocusListener[] getFocusListeners() 返回在此组件上注册的所有焦点侦听器的数组。 |
| 59 |
Set<AWTKeyStroke> getFocusTraversalKeys(int id) 返回此组件的给定遍历操作的焦点遍历键集。 |
| 60 |
boolean getFocusTraversalKeysEnabled() 返回是否为此组件启用焦点遍历键。 |
| 61 |
Font getFont() 获取该组件的字体。 |
| 62 |
FontMetrics getFontMetrics(Font font) 获取指定字体的字体规格。 |
| 63 |
Color getForeground() 获取该组件的前景色。 |
| 64 |
Graphics getGraphics() 为此组件创建图形上下文。 |
| 65 |
GraphicsConfiguration getGraphicsConfiguration() 获取与此 Component 关联的 GraphicsConfiguration。 |
| 66 |
int getHeight() 返回此组件的当前高度。 |
| 67 |
HierarchyBoundsListener[] getHierarchyBoundsListeners() 返回在此组件上注册的所有层次边界侦听器的数组。 |
| 68 |
HierarchyListener[] getHierarchyListeners() 返回在此组件上注册的所有层次结构侦听器的数组。 |
| 69 |
boolean getIgnoreRepaint() |
| 70 |
InputContext getInputContext() 当在此组件中输入文本时,获取此组件用于处理与输入法的通信的输入上下文。 |
| 71 |
InputMethodListener[] getInputMethodListeners() 返回在此组件上注册的所有输入法侦听器的数组。 |
| 72 |
InputMethodRequests getInputMethodRequests() 获取支持来自此组件的输入法请求的输入法请求处理程序。 |
| 73 |
KeyListener[] getKeyListeners() 返回在此组件上注册的所有键侦听器的数组。 |
| 74 |
<T extends EventListener> T[] getListeners(Class<T> listenerType) 返回当前在此组件上注册为 FooListeners 的所有对象的数组。 |
| 75 |
Locale getLocale() 获取此组件的语言环境。 |
| 76 |
Point getLocation() 以指定组件左上角的点的形式获取此组件的位置。 |
| 77 |
Point getLocation(Point rv) 将此组件的 x,y 原点存储到"返回值"rv 中并返回 rv。 |
| 78 |
Point getLocationOnScreen() 以点的形式获取此组件的位置,该点指定组件在屏幕坐标空间中的左上角。 |
| 79 |
Dimension getMaximumSize() 获取此组件的最大大小。 |
| 80 |
Dimension getMinimumSize() 获取此组件的最小尺寸。 |
| 81 |
MouseListener[] getMouseListeners() 返回在此组件上注册的所有鼠标侦听器的数组。 |
| 82 |
MouseMotionListener[] getMouseMotionListeners() 返回在此组件上注册的所有鼠标运动侦听器的数组。 |
| 83 |
Point getMousePosition() 如果 Component 在鼠标指针正下方,则返回鼠标指针在此 Component 坐标空间中的位置,否则返回 null。 |
| 84 |
MouseWheelListener[] getMouseWheelListeners() 返回在此组件上注册的所有鼠标滚轮侦听器的数组。 |
| 85 |
String getName() 获取组件的名称。 |
| 86 |
Container getParent() 获取此组件的父级。 |
| 87 |
java.awt.peer.ComponentPeer getPeer() 已弃用。 从 JDK 1.1 版开始,程序不应直接操作对等点; 替换为布尔 isDisplayable()。 |
| 88 |
Dimension getPreferredSize() 获取此组件的首选大小。 |
| 89 |
PropertyChangeListener[] getPropertyChangeListeners() 返回在此组件上注册的所有属性更改侦听器的数组。 |
| 90 |
PropertyChangeListener[] getPropertyChangeListeners(String propertyName) 返回与命名属性关联的所有侦听器的数组。 |
| 91 |
Dimension getSize() 以 Dimension 对象的形式返回此组件的大小。 |
| 92 |
Dimension getSize(Dimension rv) 将此组件的宽度/高度存储到"返回值:rv 并返回 rv. |
| 93 |
Toolkit getToolkit() 获取该组件的工具包。 |
| 94 |
Object getTreeLock() 为 AWT 组件树和布局操作获取此组件锁定对象(拥有线程同步监视器的对象)。 |
| 95 |
int getWidth() 返回此组件的当前宽度。 |
| 96 |
int getX() 返回组件原点的当前 x 坐标。 |
| 97 |
int getY() 返回组件原点的当前 y 坐标。 |
| 98 |
boolean gotFocus(Event evt, Object what) 已弃用。 从 JDK 1.1 版开始,由 processFocusEvent(FocusEvent) 取代。 |
| 99 |
boolean handleEvent(Event evt) 已弃用。 从 JDK 1.1 版开始,由 processEvent(AWTEvent) 取代。 |
| 100 |
boolean hasFocus() 如果此 Component 是焦点所有者,则返回 true。 |
| 101 |
void hide() 已弃用。 从 JDK 版本 1.1 开始,由 setVisible(boolean) 取代。 |
| 102 |
boolean imageUpdate(Image img,int infoflags,int x,int y,int w,int h) 当图像改变时重绘组件。 |
| 103 |
boolean inside(int x,int y) 已弃用。 从 JDK 1.1 版开始,由 contains(int, int) 取代。 |
| 104 |
void invalidate() 使该组件无效。 |
| 105 |
boolean isBackgroundSet() 返回是否已为此组件显式设置背景颜色。 |
| 106 |
boolean isCursorSet() 返回是否已为此组件显式设置光标。 |
| 107 |
boolean isDisplayable() 确定此组件是否可显示。 |
| 108 |
boolean isDoubleBuffered() 如果将此组件绘制到稍后复制到屏幕的离屏图像(缓冲区),则返回 true。 |
| 109 |
boolean isEnabled() 确定是否启用此组件。 |
| 110 |
boolean isFocusable() 返回此 Component 是否可以聚焦。 |
| 111 |
boolean isFocusCycleRoot(Container container) 返回指定的 Container 是否为本 Component 的焦点遍历循环的焦点循环根。 |
| 112 |
boolean isFocusOwner() 如果此 Component 是焦点所有者,则返回 true。 |
| 113 |
boolean isFocusTraversable() 已弃用。 从 1.4 开始,由 isFocusable() 取代。 |
| 114 |
boolean isFontSet() 返回是否已为此组件显式设置字体。 |
| 115 |
boolean isForegroundSet() 返回是否已为此组件显式设置前景色。 |
| 116 |
boolean isLightweight() 轻量级组件没有原生工具包对等体。 |
| 117 |
boolean isMaximumSizeSet() 如果最大大小已设置为非空值,则返回 true,否则返回 false。 |
| 118 |
boolean isMinimumSizeSet() 返回是否已使用非空值调用 setMinimumSize。 |
| 119 |
boolean isOpaque() 如果此组件完全不透明,则返回 true,默认返回 false。 |
| 120 |
boolean isPreferredSizeSet() 如果首选大小已设置为非空值,则返回 true,否则返回 false。 |
| 121 |
boolean isShowing() 确定此组件是否显示在屏幕上。 |
| 122 |
boolean isValid() 确定此组件是否有效。 |
| 123 |
boolean isVisible() 确定此组件在其父组件可见时是否应该可见。 |
| 124 |
boolean keyDown(Event evt,int key) 已弃用。 从 JDK 1.1 版开始,由 processKeyEvent(KeyEvent) 取代。 |
| 125 |
boolean keyUp(Event evt,int key) 已弃用。 从 JDK 1.1 版开始,由 processKeyEvent(KeyEvent) 取代。 |
| 126 |
void layout() 已弃用。 从 JDK 1.1 版开始,由 doLayout() 取代。 |
| 127 |
void list() 将此组件的列表打印到标准系统输出流 System.out。 |
| 128 |
void list(PrintStream out) 将此组件的列表打印到指定的输出流。 |
| 129 |
void list(PrintStream out,int indent) 从指定的缩进开始,将列表打印到指定的打印流。 |
| 130 |
void list(PrintWriter out) 将列表打印到指定的打印作者。 |
| 131 |
void list(PrintWriter out,int indent) 从指定的缩进开始,将列表打印到指定的打印写入器。 |
| 132 |
Component locate(int x,int y) 已弃用。 从 JDK 1.1 版开始,由 getComponentAt(int, int) 取代。 |
| 133 |
Point location() 已弃用。 从 JDK 版本 1.1 开始,由 getLocation() 取代。 |
| 134 |
boolean lostFocus(Event evt, Object what) 已弃用。 从 JDK 版本 1.1 开始,由 processFocusEvent(FocusEvent) 取代。 |
| 135 |
boolean mouseDown(Event evt,int x,int y) 已弃用。 从 JDK 版本 1.1 开始,由 processMouseEvent(MouseEvent) 取代。 |
| 136 |
boolean mouseDrag(Event evt,int x,int y) 已弃用。 从 JDK 版本 1.1 开始,由 processMouseMotionEvent(MouseEvent) 取代。 |
| 137 |
boolean mouseEnter(Event evt,int x,int y) 已弃用。 从 JDK 版本 1.1 开始,由 processMouseEvent(MouseEvent) 取代。 |
| 138 |
boolean mouseExit(Event evt,int x,int y) 已弃用。 从 JDK 版本 1.1 开始,由 processMouseEvent(MouseEvent) 取代。 |
| 139 |
boolean mouseMove(Event evt,int x,int y) 已弃用。 从 JDK 版本 1.1 开始,由 processMouseMotionEvent(MouseEvent) 取代。 |
| 140 |
boolean mouseUp(Event evt,int x,int y) 已弃用。 从 JDK 版本 1.1 开始,由 processMouseEvent(MouseEvent) 取代。 |
| 141 |
void move(int x,int y) 已弃用。 从 JDK 版本 1.1 开始,由 setLocation(int, int) 取代。 |
| 142 |
void nextFocus() 已弃用。 从 JDK 版本 1.1 开始,由 transferFocus() 取代。 |
| 143 |
void paint(Graphics g) 绘制此组件。 |
| 144 |
void paintAll(Graphics g) 绘制此组件及其所有子组件。 |
| 145 |
boolean postEvent(Event e) 已弃用。 从 JDK 版本 1.1 开始,由 dispatchEvent(AWTEvent) 取代。 |
| 146 |
boolean prepareImage(Image image,int width,int height, ImageObserver observer) 准备在此组件上以指定宽度和高度呈现的图像。 |
| 147 |
void print(Graphics g) 打印此组件。 |
| 148 |
void printAll(Graphics g) 打印此组件及其所有子组件。 |
| 149 |
protectedvoid processComponentEvent(ComponentEvent e) 通过将在此组件上发生的组件事件分派到任何已注册的 ComponentListener 对象来处理它们。 |
| 150 |
protected void processEvent(AWTEvent e) 处理此组件上发生的事件。 |
| 151 |
protected void processFocusEvent(FocusEvent e) 通过将在此组件上发生的焦点事件分派给任何已注册的 FocusListener 对象来处理它们。 |
| 152 |
protected void processHierarchyBoundsEvent(HierarchyEvent e) 通过将在此组件上发生的层次结构边界事件分派到任何已注册的 HierarchyBoundsListener 对象来处理它们。 |
| 153 |
protected void processHierarchyEvent(HierarchyEvent e) 通过将在此组件上发生的层次结构事件分派给任何已注册的 HierarchyListener 对象来处理它们。 |
| 154 |
protectedvoid processInputMethodEvent(InputMethodEvent e) 通过将在此组件上发生的输入法事件分派到任何已注册的 InputMethodListener 对象来处理它们。 |
| 155 |
protected void processKeyEvent(KeyEvent e) 通过将在此组件上发生的关键事件分派给任何已注册的 KeyListener 对象来处理它们。 |
| 156 |
protected void processMouseEvent(MouseEvent e) 通过将鼠标事件分派到任何已注册的 MouseListener 对象来处理此组件上发生的鼠标事件。 |
| 157 |
protected void processMouseMotionEvent(MouseEvent e) 通过将在此组件上发生的鼠标运动事件分派给任何已注册的 MouseMotionListener 对象来处理它们。 |
| 158 |
protected void processMouseWheelEvent(MouseWheelEvent e) 通过将鼠标滚轮事件分派到任何已注册的 MouseWheelListener 对象来处理此组件上发生的鼠标滚轮事件。 |
| 159 |
void remove(MenuComponent popup) 从组件中移除指定的弹出菜单。 |
| 160 |
void removeComponentListener(ComponentListener l) 移除指定的组件侦听器,使其不再接收来自该组件的组件事件。 |
| 161 |
void removeFocusListener(FocusListener l) 移除指定的焦点侦听器,使其不再接收来自该组件的焦点事件。 |
| 162 |
void removeHierarchyBoundsListener(HierarchyBoundsListener l) 移除指定的层次边界侦听器,使其不再接收来自该组件的层次边界事件。 |
| 163 |
void removeHierarchyListener(HierarchyListener l) 删除指定的层次结构侦听器,使其不再接收来自该组件的层次结构更改事件。 |
| 164 |
void removeInputMethodListener(InputMethodListener l) 移除指定的输入法侦听器,使其不再接收来自该组件的输入法事件。 |
| 165 |
void removeKeyListener(KeyListener l) 移除指定的按键监听器,使其不再接收来自该组件的按键事件。 |
| 166 |
void removeMouseListener(MouseListener l) 移除指定的鼠标侦听器,使其不再接收来自该组件的鼠标事件。 |
| 167 |
void removeMouseMotionListener(MouseMotionListener l) 移除指定的鼠标运动侦听器,使其不再接收来自该组件的鼠标运动事件。 |
| 168 |
void removeMouseWheelListener(MouseWheelListener l) 移除指定的鼠标滚轮侦听器,使其不再接收来自该组件的鼠标滚轮事件。 |
| 169 |
void removeNotify() 通过破坏其本机屏幕资源使该组件无法显示。 |
| 170 |
void removePropertyChangeListener(PropertyChangeListener listener) 从侦听器列表中移除一个 PropertyChangeListener。 |
| 171 |
void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) 从特定属性的侦听器列表中移除 PropertyChangeListener。 |
| 172 |
void repaint() 重绘此组件。 |
| 173 |
void repaint(int x,int y,int width,int height) 重绘该组件的指定矩形。 |
| 174 |
void repaint(long tm) 重绘组件。 |
| 175 |
void repaint(long tm,int x,int y,int width,int height) 在 tm 毫秒内重新绘制此组件的指定矩形。 |
| 176 |
void requestFocus() 请求该组件获得输入焦点,并且该组件的顶级祖先成为焦点窗口。 |
| 177 |
protected boolean requestFocus(boolean temporary) 请求该组件获得输入焦点,并且该组件的顶级祖先成为焦点窗口。 |
| 178 |
boolean requestFocusInWindow() 如果该组件的顶级祖先已经是焦点窗口,则请求该组件获得输入焦点。 |
| 179 |
protected boolean requestFocusInWindow(boolean temporary) 如果该组件的顶级祖先已经是焦点窗口,则请求该组件获得输入焦点。 |
| 180 |
void reshape(int x,int y,int width,int height) 已弃用。 从 JDK 版本 1.1 开始,由 setBounds(int, int, int, int) 取代。 |
| 181 |
void resize(Dimension d) 已弃用。 从 JDK 1.1 版开始,由 setSize(Dimension) 取代。 |
| 182 |
void resize(int width,int height) 已弃用。 从 JDK 版本 1.1 开始,由 setSize(int, int) 取代。 |
| 183 |
void setBackground(Color c) 设置此组件的背景颜色。 |
| 184 |
void setBounds(int x,int y,int width,int height) 移动此组件并调整其大小。 |
| 185 |
void setBounds(Rectangle r) 移动该组件并调整其大小以符合新的边界矩形 r。 |
| 186 |
void setComponentOrientation(ComponentOrientation o) 设置用于对该组件中的元素或文本进行排序的语言敏感方向。 |
| 187 |
void setCursor(Cursor cursor) 将光标图像设置为指定的光标。 |
| 188 |
void setDropTarget(DropTarget dt) 将 DropTarget 与此组件相关联。 |
| 189 |
void setEnabled(boolean b) 根据参数 b 的值启用或禁用此组件。 |
| 190 |
void setFocusable(boolean focusable) 将此组件的可聚焦状态设置为指定值。 |
| 191 |
void setFocusTraversalKeys(int id, Set<? extends AWTKeyStroke> keystrokes) 为此组件的给定遍历操作设置焦点遍历键。 |
| 192 |
void setFocusTraversalKeysEnabled(boolean focusTraversalKeysEnabled) 设置是否为此组件启用焦点遍历键。 |
| 193 |
void setFont(Font f) 设置此组件的字体。 |
| 194 |
void setForeground(Color c) 设置此组件的前景色。 |
| 195 |
void setIgnoreRepaint(boolean ignoreRepaint) 设置是否应忽略从操作系统接收到的绘制消息。 |
| 196 |
void setLocale(Locale l) 设置此组件的语言环境。 |
| 197 |
void setLocation(int x,int y) 将此组件移动到新位置。 |
| 198 |
void setLocation(Point p) 将此组件移动到新位置。 |
| 199 |
void setMaximumSize(Dimension maximumSize) 将此组件的最大大小设置为一个常数值。 |
| 200 |
void setMinimumSize(Dimension minimumSize) 将此组件的最小大小设置为一个常数值。 |
| 201 |
void setName(String name) 将组件的名称设置为指定的字符串。 |
| 202 |
void setPreferredSize(Dimension preferredSize) 将此组件的首选大小设置为常量值。 |
| 203 |
void setSize(Dimension d) 调整此组件的大小,使其具有宽度 d.width 和高度 d.height。 |
| 204 |
void setSize(int width,int height) 调整此组件的大小,使其具有宽度 width 和高度 height。 |
| 205 |
void setVisible(boolean b) 根据参数 b 的值显示或隐藏此组件。 |
| 206 |
void show() 已弃用。 从 JDK 版本 1.1 开始,由 setVisible(boolean) 取代。 |
| 207 |
void show(boolean b) 已弃用。 从 JDK 版本 1.1 开始,由 setVisible(boolean) 取代。 |
| 208 |
Dimension size() 已弃用。 从 JDK 1.1 版开始,由 getSize() 取代。 |
| 209 |
String toString() 返回此组件及其值的字符串表示形式。 |
| 210 |
void transferFocus() 将焦点转移到下一个组件,就好像这个组件是焦点所有者一样。 |
| 211 |
void transferFocusBackward() 将焦点转移到前一个组件,就好像这个组件是焦点所有者一样。 |
| 212 |
void transferFocusUpCycle() 将焦点向上转移一个焦点遍历循环。 |
| 213 |
void update(Graphics g) 更新此组件。 |
| 214 |
void validate() 确保此组件具有有效的布局。 |
| 215 |
Rectangle bounds() 已弃用。 从 JDK 1.1 版开始,由 getBounds() 取代。 |
| 216 |
protected AWTEvent coalesceEvents(AWTEvent existingEvent, AWTEvent newEvent) 可能将发布的事件与现有事件合并。 |
| 217 |
protected String paramString() 返回表示此组件状态的字符串。 |
| 218 |
protected void firePropertyChange(String propertyName,int oldValue,int newValue) 支持报告整数属性的绑定属性更改。 |
| 219 |
Dimension preferredSize() 已弃用。 从 JDK 1.1 版开始,由 getPreferredSize() 取代。 |
| 220 |
boolean prepareImage(Image image, ImageObserver observer) 准备要在此组件上呈现的图像。 |
| 221 |
Dimension minimumSize() 已弃用。 从 JDK 1.1 版开始,由 getMinimumSize() 取代。 |
继承的方法
这个类继承了以下类的方法 −
- java.lang.Object

