Created
June 14, 2012 06:18
-
-
Save HanSolo/2928302 to your computer and use it in GitHub Desktop.
JavaFX iOS6 style clock control (needs >= jfxtras-labs-0.2-SNAPSHOT.jar)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import javafx.application.Application; | |
import javafx.scene.Scene; | |
import javafx.scene.layout.StackPane; | |
import javafx.scene.paint.Color; | |
import javafx.stage.Stage; | |
import jfxtras.labs.scene.control.gauge.Clock; | |
import jfxtras.labs.scene.control.gauge.ClockBuilder; | |
public class IOS6Clock extends Application | |
{ | |
@Override public void start(Stage stage) throws Exception { | |
Clock clock = ClockBuilder.create() | |
.secondPointerPaint(Color.rgb(215, 30, 30)) | |
.brightPointerPaint(Color.rgb(50, 50, 50)) | |
.brightTickMarkPaint(Color.rgb(50, 50, 50)) | |
.brightBackgroundPaint(Color.rgb(234, 234, 234)) | |
.clockStyle(Clock.ClockStyle.IOS6) | |
.prefWidth(250) | |
.prefHeight(250) | |
.running(true) | |
.build(); | |
StackPane pane = new StackPane(); | |
pane.getChildren().add(clock); | |
Scene scene = new Scene(pane, Color.rgb(218, 218, 218)); | |
stage.setTitle("iOS 6 Clock"); | |
stage.setScene(scene); | |
stage.show(); | |
} | |
public static void main(final String[] args) { | |
Application.launch(args); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment