import java.awt.*; import java.awt.geom.*; import java.awt.font.*; public class Varv extends Canvas{ public void paint(Graphics g){ //Graphics2D g=(Graphics2D)alggr; float heledus = ((float)varviheledus) / 1000f; Color col = Color.getHSBColor(0.04705f, 0.9333f, heledus); g.setColor(col); /*g.setPaint(new GradientPaint(0, 100, Color.yellow, 100, 100, new Color(0, 200, 100), true ));*/ g.fillRect(0, 0, getSize().width-10, getSize().height-6); } protected int varviheledus; public Varv(){ varviheledus=0; } public Varv(int uusvarv){ varviheledus=uusvarv; } public void muudaVarv(int uusvarv){ varviheledus=uusvarv; repaint(); } }