import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class newlift extends JFrame
{
        JLabel l1,l2;
        JTextField text1,text2;
        int my,mx,ny,nx,data1,data2;

        public newlift()
        {
                l1=new JLabel("X :");
                l2=new JLabel("Y :");
                text1=new JTextField();
                text2=new JTextField();
                Container c=getContentPane();
                c.setLayout(null);
                l1.setBounds(10,40,100,15);
                l2.setBounds(10,65,100,15);
                text1.setBounds(120,40,390,15);
                text2.setBounds(120,65,390,15);
                c.add(l1);
                c.add(l2);
                c.add(text1);
                c.add(text2);

                addWindowListener(new WindowAdapter(){
                   public void windowClosing(WindowEvent e)
                      {System.exit(0);
                      }});

   /*             addMouseMotionListener(new MouseMotionAdapter(){
                   public void mouseMoved(MouseEvent m)
                      {int mx=m.getX();
                       int my=m.getY();
                       setCursor(Cursor.getDefaultCursor());
                       if ((mx>=10)&&(mx<=510))
                           {if((my>=100)&&(my<=300))
                              {   setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
                              }
                           }
                      }});

                addMouseListener(new MouseAdapter(){
                   public void mouseClicked(MouseEvent n)
                      {System.out.print("BBB");
                       int nx=n.getX();
                       int ny=n.getY();
                       if((nx>=10)&&(nx<=510))
                          {if ((my>=100)&&(my<=390))
                             {try
                                 {int data1=Integer.parseInt(text1.getText());
                                  int data2=Integer.parseInt(text2.getText());
                                 }catch(NumberFormatException e)
                                 {JOptionPane.showMessageDialog(null,"Warning!");}
                                  catch(Exception e){System.out.print("AAAAA");}
                                  repaint();
                             }
                          }
                      }});     */
                }

                public void paint(Graphics g)
                        {int y=data1*data2;
                        int c=0;
                        int l=100;
                           for (int n=1;n<=y;n++)
                               {c=c+20;
                               if(c>500)
                                 {l=l+20;
                                 c=20;
                                 }
                               g.drawOval(c,l,10,10);
                               }
                        }
        public static void main (String arg[])
                {newlift n1=new newlift();
                n1.setSize(520,400);
                n1.setVisible(true);
                n1.show();
                }
}