📄 singlelineborder.java
字号:
package wapide;import java.awt.*;import javax.swing.*;import javax.swing.border.*;/** * A border style used to show that controls are selected in the GraphicalTextPane. * Copyright: Copyright (c) 2003 * @author Mark Busman * @version 1.0 * * For License and contact information see WAPIDE.java */public class SingleLineBorder implements Border { /** * The color to draw the lines with. */ private Color lineColor; /** * Default constructor. * @param Color c - line color. */ public SingleLineBorder(Color c) { lineColor = c; } /** * Gets the border insets for the specified Component. * @param Component c. * @return Insets i. */ public Insets getBorderInsets(Component c) { return new Insets(3, 3, 3, 3); } /** * Returns border opacity. * @return boolean opacity - always false. */ public boolean isBorderOpaque() { return false; } /** * Paints the border */ public void paintBorder(Component c, Graphics g, int x ,int y, int width, int height) { g.setColor(lineColor); g.fillRect(x, y + height - 2, x + width, y + height - 1); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -