Results 1 to 8 of 8
Thread: Help with javaFX?!
- 07-16-2012, 11:20 PM #1
Member
- Join Date
- Jul 2012
- Posts
- 4
- Rep Power
- 0
Help with javaFX?!
I'm trying to code a media player with javaFX. Is it possible to internalize the media being played into a window? An example would be if there is dedicated space for the video and then when you click on an item it plays within the window. Basically youtube but with saved videos already there.
- 07-17-2012, 01:33 AM #2
Senior Member
- Join Date
- Apr 2010
- Location
- Belgrade, Serbia
- Posts
- 278
- Rep Power
- 4
Re: Help with javaFX?!
I think that is possible.
Maybe this links might be helpful:
How to make movie player using Java / JavaFX? - YouTube
Harmonyfx - JavaFX media Player - YouTube
- 07-18-2012, 05:27 PM #3
Member
- Join Date
- Jul 2012
- Posts
- 4
- Rep Power
- 0
JavaFX and normal Java
I have created a GUI in normal java code, and now I have created a media player that plays video in JavaFX. When I try start the media player in the normal application, even though JavaFX is part of the package it can't run the media player and when the GUI is started in the JavaFX application it can't start.
If anyone can share some light on this, it would be greatly appreciated.
- 07-18-2012, 06:10 PM #4
Moderator
- Join Date
- Apr 2009
- Posts
- 10,481
- Rep Power
- 16
Re: JavaFX and normal Java
What do "it can't run" and "it can't start" mean?
What is it you are seeing that is wrong?
Any exceptions (including full stack traces)?Please do not ask for code as refusal often offends.
- 07-18-2012, 07:10 PM #5
Member
- Join Date
- Jul 2012
- Posts
- 4
- Rep Power
- 0
Re: JavaFX and normal Java
I have a media player class, here:
I have a main menu, where I wish to launch the mediaplayer:XML Code:public class player extends Application{ @Override public void start(final Stage stage) throws Exception { //CONTENTS NOT APPLICABLE TO SITUATION }
I then get the following error when I click the button:XML Code:public class VA_MainMenu extends javax.swing.JFrame { public VA_MainMenu() { initComponents(); } private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { Stage stage = null; player play = new player(); try { play.start(stage); } catch (Exception ex) { Logger.getLogger(VA_MainMenu.class.getName()).log(Level.SEVERE, null, ex); } }
Jul 18, 2012 7:03:24 PM VSA.VA_MainMenu jButton1ActionPerformed
SEVERE: null
java.lang.NullPointerException
But when I run the same code in the JavaFX environment like this (obviously without the try/catch because the method throws the Exception):
The media player opens. Which leaves the question: Is it at all possible for me to launch the media player from an environment where there's a button?XML Code:public class Main extends Application { /** * @param args the command line arguments */ public static void main(String[] args) { launch(args); } @Override public void start(Stage stage) throws Exception { player play = new player(); play.start(stage); } }
Much appreciated.
- 07-18-2012, 10:34 PM #6
Re: JavaFX and normal Java
Yes, it's possible, but you have to take care of the threading issues. Go through JavaFX for Swing Developers: About This Tutorial | JavaFX 2 Tutorials and Documentation
In future, please post JavaFX questions in the JavaFX section.
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 07-18-2012, 10:54 PM #7
Re: Help with javaFX?!
Moved from New to Java
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 07-18-2012, 10:56 PM #8
Similar Threads
-
Eclipse JavaFX Support
By mlpehlivan in forum EclipseReplies: 1Last Post: 03-11-2012, 01:44 PM -
JAVAFX 2.0 popup menu
By bockymurphy in forum JavaFXReplies: 0Last Post: 01-12-2012, 02:10 AM -
JavaFX not able to read images
By ajeeb in forum NetBeansReplies: 4Last Post: 02-16-2010, 03:16 PM -
Mysql and JavaFX
By cjr9968 in forum JDBCReplies: 11Last Post: 01-29-2010, 02:51 AM -
JavaFX Script and JavaFX Mobile
By levent in forum Java SoftwareReplies: 1Last Post: 01-27-2010, 04:48 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks