import java.awt.*; import java.awt.event.*; public class Margistusala1 extends Panel implements MouseListener{ int kogupikkus=50000; double algusprotsent=0.1, loppprotsent=0.4; Color margistusvarv=Color.orange; public Margistusala1(){ setBackground (Color.lightGray); addMouseListener(this); } public void paint(Graphics g){ g.setColor(margistusvarv); g.fillRect( (int)(algusprotsent*getWidth()), 0, (int)((loppprotsent-algusprotsent)*getWidth()), getHeight() ); } public void mousePressed(MouseEvent e){ algusprotsent=e.getX()/(double)getWidth(); } public void mouseReleased(MouseEvent e){ loppprotsent=e.getX()/(double)getWidth(); if(loppprotsent