Examples of GLine


Examples of acm.graphics.GLine

  }
 
  //initialize the race
  public void init(){
    //draw start line using blue color
    GLine startLine = new GLine(START_X, START_Y, START_X, START_Y + NUMRACERS * LANEWIDTH );
    startLine.setColor(Color.BLUE);
    add(startLine);
   
    //draw finish line using red color
    GLine finishLine = new GLine(START_X + STEPSPAN * NUMSTEPS, START_Y, START_X + STEPSPAN * NUMSTEPS, START_Y + NUMRACERS * LANEWIDTH);
    finishLine.setColor(Color.RED);
    add(finishLine);
   
    //create the button and add action listener(instead of mouse listener)
    add(new JButton("Let's Rock!"), SOUTH);
    add(new JButton("Again!"), SOUTH);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.