Exemple #1
0
  /** paints the Spinner */
  public void paint(Graphics g) {
    int start_angle = 90;
    int done_angle = (int) (percentDone * 360);

    g.setColor(getBackground());
    g.fillArc(3, 3, getSize().width - 8, getSize().height - 8, 0, 360);

    g.setColor(getForeground());
    g.fillArc(3, 3, getSize().width - 8, getSize().height - 8, start_angle, done_angle);

    g.setColor(Color.black);
    g.drawArc(3, 3, getSize().width - 8, getSize().height - 8, 0, 360);
  }
 public void paint(Graphics g) {
   int x1 = 30;
   int y1 = 30;
   int x2 = 60;
   int y2 = 50;
   g.drawRect(x1, y1, x2, y2);
   x1 = 80;
   y1 = 80;
   x2 = 100;
   y2 = 100;
   g.drawOval(x1, y1, x2, y2);
   x1 = 200;
   y1 = 60;
   x2 = 60;
   y2 = 60;
   g.drawArc(x1, y1, x2, y2, 0, 180);
 }