import java.awt.*; import javax.swing.*; public class TenniseManguPlats extends JPanel{ int pallix, palliy, reket1x, reket2x; public TenniseManguPlats(){ setFocusable(true); } public void paintComponent(Graphics g){ super.paintComponent(g); g.drawLine(reket1x, TenniseManguServer.REKET1Y, reket1x+TenniseManguServer.REKETILAIUS, TenniseManguServer.REKET1Y); g.drawLine(reket2x, TenniseManguServer.REKET2Y, reket2x+TenniseManguServer.REKETILAIUS, TenniseManguServer.REKET2Y); g.drawOval(pallix-TenniseManguServer.PALLIRAADIUS, palliy-TenniseManguServer.PALLIRAADIUS, 2*TenniseManguServer.PALLIRAADIUS, 2*TenniseManguServer.PALLIRAADIUS); } public void asukohad(int r1x, int r2x, int px, int py){ pallix=px; palliy=py; reket1x=r1x; reket2x=r2x; repaint(); } }