是否可以在JavaFX中创建与Google地图中的photoshpere类似的光球?如果有,怎么样?
我是JavaFX的新手,我目前正在使用在应用程序开始时播放视频(.MP4)的应用程序,但是,我似乎无法使它工作!请告诉我我的代码有什么问题:
import java.io.File;
import javafx.geometry.Pos;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
import javafx.scene.media.Media;
import javafx.scene.media.MediaPlayer;
import javafx.scene.media.MediaView;
import javafx.scene.text.Text;
public class NoConnection {
private StackPane root;
public NoConnection(){
Media media = null;
try{
File video = new File("video.mp4");
String url = video.toURI().toURL().toString();
System.out.println("URL: "+url);
media = new Media(url);
}catch(Exception e){
System.err.println(e.toString());
}
MediaPlayer player = new MediaPlayer(media);
player.play();
MediaView mediaView = new MediaView(player);
root = new StackPane();
root.setAlignment(Pos.CENTER);
root.setStyle("-fx-background-color : white;");
root.getChildren().add(mediaView);
}
public StackPane getLayout(){
return root; …Run Code Online (Sandbox Code Playgroud) 我将我的JavaFX应用程序移植到我的Android设备上.我希望我的应用程序读取传入的SMS消息并将其存储在数据库中.我在StackOverflow中找到了几个问题,但我不知道如何在JavaFX方法中实现.请帮忙!