ovalicon.java

来自「java swing 开发代码」· Java 代码 · 共 25 行

JAVA
25
字号
// OvalIcon.java// A simple icon implementation that draws ovals.//package	jswing.ch04;import javax.swing.*;import java.awt.*;public class OvalIcon implements Icon {  private int width, height;  public OvalIcon(int w, int h) {    width = w;    height = h;  }  public void paintIcon(Component c, Graphics g, int x, int y) {    g.drawOval(x, y, width-1, height-1);  }  public int getIconWidth() { return width; }  public int getIconHeight() { return height; }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?