Button Code

     ball aball3 = new ball(15, 0, 25, 15, 2, 1, 
                jPanel1.getWidth() - 15, 
                jPanel1.getHeight() - 15, 
                Color.green);

        aball3.setSize(jPanel1.getWidth() - 15, jPanel1.getHeight() - 15);
        aball3.setLocation(0, 0);
        jPanel1.add(aball3);