Package com.msjackiebrown.bouncingballs

Examples of com.msjackiebrown.bouncingballs.Ball


     
    }
   
    public void addBall() {
     
      Ball b= new Ball();
      Thread t= new Thread(b);
     
      balls.add(numberBalls, b);
      threads.add(t);
     
View Full Code Here


    // Update the info panel with current ball
   
    int index = ballindex.getSelectedIndex();
   
    if (index==-1) return;
    Ball  currentBall = BallPanel.getBalls().get(index);
    preview.repaint();
    radius.setValue(currentBall.getRadius());
    speed.setValue(currentBall.getSpeed());
   
    Color color = currentBall.getColor();
   
    jslRed.setValue(color.getRed());
    jslGreen.setValue(color.getGreen());
    jslBlue.setValue(color.getBlue());
   
View Full Code Here

        super.paintComponent(g);
       
        this.setSize(300,300);
        int index = ballindex.getSelectedIndex();
       
        Ball  currentball = BallPanel.getBalls().get(index);
       
        int radius = currentball.getRadius();
       
        //Draw rectangle (yellow)
        g.setColor(Color.BLACK);
     
        int  x = this.getWidth()/2;
        int  y = this.getHeight()/2;
       

       
         g.setColor(currentball.getColor());
         g.fillOval(x-radius,y-radius,radius*2,radius*2);
       
       
     
 
View Full Code Here

TOP

Related Classes of com.msjackiebrown.bouncingballs.Ball

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.