📄 ovalicon.java
字号:
// 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -