Sample Java Program to Display Color of Circle

Download Solution: Click to Download Solution
Solution File Name: JavaProgramDisplayColorCircle.docx
Unzip Password: prestobear.com

Problem:
Write a program that displays the color of a circle as
black when the mouse button is pressed and as white when
the mouse button is released.


1. TestEx157.java
import javafx.application.Application;
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.layout.StackPane;
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;
import javafx.stage.Stage;
import javafx.scene.input.MouseEvent;
import javafx.scene.input.KeyEvent;

/**
 *      Write a program that displays the color of a circle as
 *      black when the mouse button is pressed and as white when
 *      the mouse button is released.
 */
public class TestEx157  extends Application{
	
}

Add Comment