/* * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. */ import javafx.animation.FadeTransition; import javafx.application.Application; import javafx.application.Platform; import javafx.scene.Group; import javafx.scene.Scene; import javafx.scene.layout.StackPane; import javafx.scene.media.Media; import javafx.scene.media.MediaPlayer; import javafx.scene.paint.Color; import javafx.scene.paint.CycleMethod; import javafx.scene.paint.LinearGradient; import javafx.scene.paint.Stop; import javafx.scene.shape.Ellipse; import javafx.scene.shape.Rectangle; import javafx.scene.text.Font; import javafx.scene.text.FontWeight; import javafx.scene.text.Text; import javafx.scene.transform.Rotate; import javafx.scene.transform.Translate; import javafx.stage.Stage; import javafx.stage.StageStyle; import javafx.util.Duration; public class Main extends Application { private static final String SOURCE = Main.class.getResource("Ronkorb_etenraku_ryuteki.wav").toExternalForm(); @Override public void start(final Stage stage) { stage.show(); // close application stage.setOnCloseRequest(t -> { Platform.exit(); System.exit(0); }); MediaPlayer sound = new MediaPlayer(new Media(SOURCE)); sound.setCycleCount(MediaPlayer.INDEFINITE); sound.play(); } public static void main(String[] args) { launch(args); } }