⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bracketborder.java

📁 WAP ide 代码
💻 JAVA
字号:
package wapide;import java.awt.*;import javax.swing.*;import javax.swing.border.*;/** * This class defines a special border used for the display of * "input" and "select tags."  In WAP these tags are enclosed as follows [data] * and this class creates these brackets graphically. * * Copyright:    Copyright (c) 2003 * @author Mark Busman * @version 1.0 * * For License and contact information see WAPIDE.java */public class BracketBorder implements Border {  /**   * The color to draw the lines with.   */  private Color lineColor;  /**   * Default constructor.   * @param Color c - line color.   */  public BracketBorder(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(0, 5, 0, 5);  }  /**   * 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.drawRect(x, y, x + 5,  y + 1);    g.fillRect(x, y, x + 2,  y + height - 2);    g.fillRect(x, y + height - 2, x + 5,  y + height - 1);    g.drawRect(x + width - 6, y, x + width - 1,  y + 1);    g.fillRect(x + width - 2, y, x + width - 1,  y + height - 2);    g.fillRect(x + width -6, y + height - 2, x + width - 1,  y + height - 1);  }}

⌨️ 快捷键说明

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