import javax.swing.*; import java.awt.*; import java.awt.event.*; public class Joonis3 extends JApplet implements ActionListener{ int kogus=5; int korgus=20; JTextField tf=new JTextField(String.valueOf(kogus)); JTextField tf2=new JTextField(String.valueOf(korgus)); JCheckBox cb=new JCheckBox(); JPanel p=new JPanel(new GridLayout(3, 2)); public Joonis3(){ p.add(new JLabel("Kogus:")); p.add(tf); p.add(new JLabel("Kõrgus:")); p.add(tf2); p.add(new JLabel("Täis:")); p.add(cb); add(p, BorderLayout.SOUTH); tf.addActionListener(this); tf2.addActionListener(this); cb.addActionListener(this); } public void actionPerformed(ActionEvent e){ kogus=Integer.parseInt(tf.getText()); korgus=Integer.parseInt(tf2.getText()); repaint(); } public void paint(Graphics g){ super.paint(g); for(int i=0; i