importjavax.swing.*;importjava.awt.*;publicclassHelloAWT{publicstaticvoidmain(String[]args){// Frame 默认的布局管理器就是 BorderLayoutFrame frame=newFrame("AWT 界面编程");Box box=Box.createVerticalBox();frame.add(box);// 多行文本TextArea textArea=newTextArea(5,30);textArea.setText("多行...
Component add(Component c) : 向Container 容器 中 添加 Component 组件 实例对象 , 返回被添加的组件 ; 注意 Container 是 Component 的子类 , 因此 此处也可以添加 Container 容器 ; Component getComponentAt(int x, int y) : 返回指定 屏幕坐标 位置的组件 ; int getComponentCount() : 获取Container 容器...
TextField :单行文本框 ; Button :按钮组件 ; Canvas :画布组件 Checkbox :复选框组件 ; CheckboxGroup :单选框组件 Choice :下拉框组件 ; List :列表组件 Panel :容器组件 ScrollBar :滑动条组件 ScrollPan :带滚动条的容器组件 二、AWT 常用组件示例 代码示例 : import javax.swing.*; import java.awt.*...
Component を返す java.awt のメソッド Component Component.getComponentAt(int x, int y) このコンポーネントまたはその直接のサブコンポーネントが位置 (x, y) を含んでいるかどうかを判定します。 Component Component.locate(int x, int y) 推奨されていません。 JDK バージョン 1.1 ...
Uses ofComponent.AccessibleAWTComponentinjava.applet Subclasses ofComponent.AccessibleAWTComponentinjava.applet Modifier and TypeClass and Description protected classApplet.AccessibleApplet This class implements accessibility support for theAppletclass.
模块 java.desktop 软件包 java.awt Class Component.AccessibleAWTComponentjava.lang.Object javax.accessibility.AccessibleContext java.awt.Component.AccessibleAWTComponent 实现的所有接口 Serializable, AccessibleComponent 已知直接子类: Box.Filler.AccessibleBoxFiller, Button.AccessibleAWTButton, Canvas....
二、Component 绘图函数 一、AWT 绘图线程 在AWT 绘图程序中 , 有一个专门的线程用于绘制界面的线程 , AWT 绘制线程 ; AWT 绘制线程 , 默认处于 等待状态 ; 当组件 第一次显示时 , 会 调用 paint(Graphics g) 函数 , 绘制组件上的所有内容 , 绘制完毕后 , AWT 绘制线程又 恢复 等待状态...
The getLocation() method returns the current position of the Component in its parent's coordinate space. The Point is the top left corner of the bounding box around the Component.location() is the Java 1.0 name for this method.public Point getLocationOnScreen () The getLocationOnScreen() ...
PREFACE xvii Java 1.1 also introduces a LightweightPeer, which means that it is possible to create "lightweight components." To do so, you subclass Component or Con- tainer directly; this wasn't possible in earlier releases. For simple operations, lightweight components are much more efficient...
GraalVM includes java.awt.Component and derived classes into native image even a Java Beans application does not use them. Steps to reproduce: Compile the BeanSample.java class which does not defi...