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

📄 linecomponent.java

📁 sound recorder which supports .wav format files
💻 JAVA
字号:
package com.vimas.interfaceapplet;

import java.awt.*;

public class LineComponent extends Component
{
  Color c;//it's color
  int direction;//VERICAL<=>HORISONTAl
  int length;//length
  public static final int VERTICAL=1;
  public static final int HORIZONTAL=2;

  public LineComponent(int direction, int length, Color c)
  {
    super();
    this.c=c;
    this.direction=direction;
    this.length=length;
  }
public void paint(Graphics g)
  {
    g.setColor(c);
    int x2=0,y2=0;
    if(direction==1) y2=length; else x2=length;
    g.drawLine(0,0,x2,y2);
  }

}

⌨️ 快捷键说明

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