Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

JavaFX MediaPlayer

4301785Aug 5 2020 — edited Aug 5 2020

I've been trying to create a Video Player in JavaFX using the Media/MediaView and MediaPlayer libraries. Everything seems to be working just fine except for the Media library, which crashes the program before anything display. I'm getting an error saying that I don't have the media library, or more specifically, the scene.control.media library. I've tried this on two different devices with different installations as well. I saw another similar issue on stack overflow where someone posted this problem, but their was no response. Any suggestions?

My current version:

package application;

import java.io.File;

import javafx.application.Application;

import javafx.stage.Stage;

import javafx.scene.Scene;

import javafx.scene.control.Button;

import javafx.scene.control.Label;

import javafx.scene.layout.GridPane;

import javafx.scene.layout.HBox;

import javafx.scene.layout.Pane;

import javafx.scene.layout.StackPane;

import javafx.scene.layout.TilePane;

import javafx.scene.layout.VBox;

import javafx.scene.media.Media;

import javafx.scene.media.MediaPlayer;

import javafx.scene.media.MediaView;

public class Main extends Application  {

public static void main(String args[]){       

launch(args);  

}

@Override  

public void start(Stage primaryStage) throws Exception {

String file = "https://coderslegacy.com/wp-content/uploads/2020/07/Pygame_Platformer.mp4";

Media media = new Media(new File(file).toURI().toString());

MediaPlayer mediaplayer = new MediaPlayer(media);

MediaView mediaView = new MediaView (mediaplayer);

Button button1 = new Button("Play");

button1.setOnAction(e -> {

mediaplayer.play();

});

GridPane layout = new GridPane();

layout.setHgap(10);

layout.setVgap(10);

layout.add(mediaView, 1, 0);

layout.add(button1, 0, 1);

Scene scene = new Scene(layout, 300, 200);

primaryStage.setTitle("JavaFX example");

primaryStage.setScene(scene);

primaryStage.show();

    }

}

I've tried looking all over the place, but can't find a solution. I've tried directly copy pasting code from working examples and tried to run it but it doesn't work. This kind of implies that the problem is with me. I have all the required files (I double checked) and I've installed everything correctly. I've been learning JavaFX from this site for over a month now.

Comments

Arpad Kiss

I think you wanted DESC, not DEPT.
DESC tablename;

Pictures are worth many words, show us

image.png

user527460

Hi, @thatjeffsmith-oracle ,
Here is the picture from SQL Developer version 21.4.3.x,
Picklist is not showing with table alias 'a' as shown here.

image.png

That query to get the column list might take a half-second, be patient
Windows 10/21.4.3
image.png

user527460

hi @thatjeffsmith-oracle ,
No luck, i waited for a min but pick list not showing. I tried to change theme to dark as showing in your image, still no pick list pops up.

ask for it multiple times, if the query takes too long, we give up

Robert Kilmer

Try Ctrl-Space.

670554

Ctrl-Space is not working in Version 22.2.1.234

it brings up a different menu.

thatJeffSmith-Oracle

23.1.1 is latest and this is your example in 23.1.1

1 - 9

Post Details

Added on Aug 5 2020
0 comments
541 views