import javax.swing.*; import java.awt.*; public class Indikaator extends JPanel{ double protsent; public Indikaator(double protsent){ this.protsent=protsent; } public void paintComponent(Graphics g){ super.paintComponent(g); g.fillRect(0, 0, getWidth(), (int)(protsent/100*getHeight())); } }