JAVA_HA15.0: Control a Clock
The following source code file –DetailedClockPaneTest.java –
==============================================================
Import java.util.Calendar;
import java.util.GregorianCalendar;
import javafx.application.Application;
import javafx.geometry.Pos;
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.Pane;
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;
import javafx.scene.shape.Line;
import javafx.scene.text.Text;
public class DetailedClockPaneTest extends Application {
@Override
// Override the start method in the Application class
Public void start(Stage primaryStage) {
// Create a clock and a label
DetailedClockPane clock = new DetailedClockPane();
String timeString = clock.getHour() + “:” + clock.getMinute() +”:” + clock.getSecond();
Label lblCurrentTime = new Label(timeString);
// Place clock and label in border pane
BorderPane pane = new BorderPane();
pane.setCenter(clock);
pane.setBottom(lblCurrentTime);
BorderPane.setAlignment(lblCurrentTime, Pos.TOP_CENTER);
// Create a scene and place it in the stage
Scene scene = new Scene(pane, 250, 250);
primaryStage.setTitle(“DetailedClockPaneTest”); // Set the stagetitle
primaryStage.setScene(scene); // Place the scene in
PayPal Gateway not configured
PayPal Gateway not configured