Unable to see video when using JavaFX JFXPanel in a JDialog

I'm trying to embed a video in a JDialog box . Finally, I need to integrate three separate videos and so I implemented the functionality to define my own implementation of JFXPanel for re-use. I am able to run the application and when I debug in the createScene is running, but I don't see any visible video and I don't get any errors. Also I tried to text output and which was not visible either. I was able to get the video I want to incorporate to display in a pure implementation of JavaFX, so I know that's not encoding or something. Can I please someone to look at the following code and give me some suggestions. I use Netbeans as IDE if it is important. Thank you!


/*

* To change this template, choose Tools | Templates

* and open the template in the editor.

*/

package swingjavafxtest;

Import javafx.embed.swing.JFXPanel;

/**

*

* @author acarnes

*/

SerializableAttribute public class SwingJavaFXTestDialog extends javax.swing.JDialog

{

private static final String BURST_OPTION_1_VIDEO = "file:///c:/vids/burst_option1.MP4";

/**

* Creates the form SwingJavaFXTestDialog

*/

public SwingJavaFXTestDialog (java.awt.Frame parent, boolean modal)

{

Super (parent, modal);

initComponents();

}

/**

* This method is called in the constructor to initialize the

* form. WARNING: Do NOT change this code. The contents of this method is

* always regenerated by the form editor.

*/

@SuppressWarnings ("unchecked")

< Publisher-fold defaultstate = "collapsed" desc = "Generated Code" >

Private Sub initComponents()

{

setDefaultCloseOperation (javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

setModalityType (java.awt.Dialog.ModalityType.APPLICATION_MODAL);

layout = new javax.swing.GroupLayout javax.swing.GroupLayout (getContentPane ());

getContentPane () .setLayout (layout);

() layout.setHorizontalGroup

layout.createParallelGroup (javax.swing.GroupLayout.Alignment.LEADING)

.addGap (0, 400, Short.MAX_VALUE)

);

() layout.setVerticalGroup

layout.createParallelGroup (javax.swing.GroupLayout.Alignment.LEADING)

.addGap (0, 300, Short.MAX_VALUE)

);

Pack();

} / / < / Publisher-trick >

/**

@param args command-line arguments

*/

Public Shared Sub main (string args [])

{

/ * Define the look and feel of Nimbus * /.

' < editor-fold defaultstate = "collapsed" desc = "Look and feel (optional) code definition ' > '.

/ * Si Nimbus (introduced in Java SE 6) is not available, stay with the default appearance.

* For details see http://download.Oracle.com/javase/tutorial/uiswing/LookAndFeel/plaf.html

*/

Try

{

for (javax.swing.UIManager.LookAndFeelInfo info: javax.swing.UIManager.getInstalledLookAndFeels ())

{

If ("Nimbus".equals (info.getName ()) ")

{

javax.swing.UIManager.setLookAndFeel (info.getClassName ());

break;

}

}

} catch (ClassNotFoundException ex)

{

java.util.logging.Logger.getLogger (SwingJavaFXTestDialog.class.getName ()) .log (java.util.logging.Level.SEVERE, null, ex);

} catch (InstantiationException ex)

{

java.util.logging.Logger.getLogger (SwingJavaFXTestDialog.class.getName ()) .log (java.util.logging.Level.SEVERE, null, ex);

} catch (IllegalAccessException ex)

{

java.util.logging.Logger.getLogger (SwingJavaFXTestDialog.class.getName ()) .log (java.util.logging.Level.SEVERE, null, ex);

} catch (javax.swing.UnsupportedLookAndFeelException ex)

{

java.util.logging.Logger.getLogger (SwingJavaFXTestDialog.class.getName ()) .log (java.util.logging.Level.SEVERE, null, ex);

}

< / Publisher-trick >

/ * Create and display the dialog box * /.

java.awt.EventQueue.invokeLater (new Runnable()

{

public void run()

{

Dialogue SwingJavaFXTestDialog = new SwingJavaFXTestDialog (new javax.swing.JFrame (), true);

JavaFXVideoPanel bo1VideoPanel = new JavaFXVideoPanel (BURST_OPTION_1_VIDEO);

Dialog.Add (bo1VideoPanel);

dialog.addWindowListener (new java.awt.event.WindowAdapter)

{

@Override

public void windowClosing (e java.awt.event.WindowEvent)

{

System.Exit (0);

}

});

dialog.setVisible (true);

}

});

}

Declaration of variables - do not modify

End of variables declaration

}

/*

* To change this template, choose Tools | Templates

* and open the template in the editor.

*/

package swingjavafxtest;

Import javafx.application.Platform;

Import javafx.embed.swing.JFXPanel;

Import javafx.scene.Group;

Import javafx.scene.Scene;

Import javafx.scene.media.Media;

Import javafx.scene.media.MediaPlayer;

Import javafx.scene.media.MediaView;

Import javafx.scene.media.Track;

Import javafx.stage.Stage;

Import javafx.scene.text.Text;

Import javafx.scene.text.Font;

Import javafx.scene.paint.Color;

/**

*

* @author acarnes

*/

SerializableAttribute public class JavaFXVideoPanel extends JFXPanel

{

public JavaFXVideoPanel (String url)

{

Super();

final String videoURL = url;

Platform.setImplicitExit (false);

Platform.runLater (new Runnable() {}

@Override

public void run() {}

createScene (videoURL);

}

});

}

Private Sub createScene (String url)

{

/ * Media bo1Media = new Media (url);

Bo1MediaPlayer MediaPlayer = new MediaPlayer (bo1Media);

bo1MediaPlayer.setAutoPlay (true);

bo1MediaPlayer.setCycleCount (javafx.scene.media.MediaPlayer.INDEFINITE);

MediaView bo1MediaView = new MediaView (bo1MediaPlayer);

Root of group = new Group();

Scene = new Scene (root, 400, 400);

root.getChildren () .add (bo1MediaView);

*/

Root of group = new Group();

Scene = new Scene (root, Color.ALICEBLUE);

Text = new Text();

text.setX (40);

text.setY (100);

text.setFont (new do (25));

text.setText ("welcome JAVAFX!");

root.getChildren () .add (text);

this.setScene (scene);

this.setVisible (true);

}

}

See the solution of the sample to: can not see the video when using JavaFX JFXPanel less a JDialog (JavaFX forum at the JavaRanch)

Tags: Java

Similar Questions

  • Pavilion dv6 laptop unable to see video - audio flickers OK Windows 7 IE9

    I'm able to view the video such as episodes of TV series. I don't know when the problem started, but I think that it is after I've updated for IE9. I ran both 32 and 64 bit, but no luck. I checked with HP to update the drivers and updates

    Adobe Flash Player to the latest version.

    Hello

    Check the following if you use IE9.

    Open windows control panel, open Internet Options and click the Advanced tab.  Under the graphic acceleration, make sure you there is not a tick against 'use made instead of GPU Rendering software.  If it is, uncheck the box and click on apply to save the change.  Restart IE.

    If the above doesn't help (or does not), download the latest installer of Flash Player and save it to your desktop (I realize that you already have the latest version, but it may be best to completely uninstall before reinstalling the latest version).  Then, close all browsers, open windows control panel, open programs and features and uninstall Flash Player.  Once completed, restart the laptop.  Now, double-click on the Setup program on your desktop to reinstall Flash Player.

    Another option is to download and install Firefox as a temporary measure, as the latest version of Adobe Flash seems to work OK with that - you may need to run the installer of Flash again after installing Firefox.

    Kind regards

    DP - K

  • getting exception when using JavaFX SDK/JRE bundled in Netbeans

    When I try to put my JavaFX SDK/JRE to use Java SE and run my application I get an exception ClassLoader (java.lang.NoClassDefFoundError: javafx/application/application).

    I still have to get my Netbeans to use properly the bundled JavaFX SDK/JRE that come with JRE/SDK to the Java SE. I am referring to Java for JavaFX platform properties (in a project-> properties-> library-> manage-> tab JavaFX platforms).

    Here's what I have my JavaFX platform settings the value:
    JavaFX SDK--> C:\Program Files (x86)\Java\jdk1.7.0_10
    JRE JavaFX--> C:\Program Files (x86)\Java\jdk1.7.0_10\jre

    I am currently using 7u10 7.2 Netbeans and Java (the problem also occurs with 7u7 and 7u6).

    For those who using Java7u6 and later, can you tell me what your platform setting manage is the JavaFX tab?

    Thank you
    Jose

    OK its fixed. I noticed that the word hellow JavaFX netbeans 7.2 contains the following pots as part of its compilation libraries, jfxrt, deploy, plugin and javaws. In my project of problem I just add them to my library of compilation and it worked.

    Thanks for the help Igor.
    Jose

  • For the last few weeks, I have been unable to navigate gmail when using Firefox, but gmail works fine in other browsers.

    When you use Firefox for Windows desktop, I was having trouble, repeated for several weeks, navigate to GMAIL. I can't open the emails, scroll forward or in any area of gmail, open folders as SPAM, TRASH, DRAFTS. Clicking on one of these links produces no response. It happens in Google calendar as well - same problem. This problem does not exist when I use another browser.

    Reload Web pages and ignore the cache to refresh potentially stale or corrupt.

    • Hold down the SHIFT key and click the Reload button
    • Press 'Ctrl + F5' or 'Ctrl + Shift + R' (Windows, Linux)
    • Press 'Command + shift + R' (Mac)

    Clear the cache and cookies from Web sites that cause problems.

    "Clear the Cache":

    • Firefox/tools > Options > advanced > network > content caching Web: 'clear now '.

    'Delete Cookies' sites causing problems:

    • Firefox/tools > Options > privacy > Cookies: "show the Cookies".

    Start Firefox in Safe Mode to check if one of the extensions (Firefox/tools > Modules > Extensions) or if hardware acceleration is the cause of the problem (switch to the DEFAULT theme: Firefox/tools > Modules > Firefox uses the subject: Access Protocol built on: pages that you open through the bar of addresses as you open webpages.)

  • I can't get the video when using firefox. I know it's a problem with firefox because I get video when you use internet explorer or google chrome.

    Plug-ins are updated. I can't understand what is wrong. He started from nothing and I have no other problems.

    Recent crashes of some multimedia content (this includes the Youtube videos, some flash games and other applications), in collaboration with Firefox 14 are probably caused by a recent update of Flash 11.3 and/or Real Player browser plugin to malfunction.

    To resolve this problem, follow the steps in these articles in the Knowledge Base:

    Flash Plugin - maintain and troubleshoot

    Adobe Flash plugin has crashed - avoid that it happen

    11.3 Flash does not load video in Firefox

    We'll find other information on more technical issues under these links:

    http://forums.Adobe.com/thread/1018071?TSTART=0

    http://blogs.Adobe.com/asset/2012/06/inside-Flash-Player-protected-mode-for-Firefox.html

    Please tell us if it helped!

  • Unable to see or hear the video on the accuweather site

    Original title: video and audio

    When on the accuweather site, I can't see or hear video

    Hello

    Thanks for posting your question in the Microsoft Community.

    I understand that you are unable to see or hear the video on the accuweather Web site. Correct me if I'm wrong.

    I imagine the inconvenience that you are experiencing. I will certainly help the question of fixing.

    To help you suggest several steps to solve the problem, I would appreciate if you could answer the following questions:

    1. is the specific question about the particular site?

    2. you receive an error code or message?

    3. what web browser do you use?

    4. did you try with another browser?

    Please follow the steps described in the links if you're using Internet Explorer and check the question below:

     

    The video problems when you use Internet Explorer:

    http://support.Microsoft.com/kb/2532294

    Warning: Reset the Internet Explorer settings can reset security settings or privacy settings that you have added to the list of Trusted Sites. Reset the Internet Explorer settings can also reset parental control settings. We recommend that you note these sites before you use the reset Internet Explorer settings.

    Note: The data files that are infected must be cleaned only by removing the file completely, which means that there is a risk of data loss.

    Videos won't play or Web pages is not displayed correctly:

    http://Windows.Microsoft.com/en-us/Internet-Explorer/videos-Don ' t work #ie = ie-9

     

    I hope the above information helps you and let me know if you need additional assistance.

  • Unable to see the video in CS4

    I improved body 1.5-CS4.  When I opened an old project of body 1.5 in CS4, or when I create a new project in CS4, everything works fine - except that I don't see video movement in one of the source, program monitor, or tiny little windows (top left) project.  Sound works fine, the clip in the project is read, but the windows are black.  When I pause and click on a window, I get a fixed image, but as soon as I press play it's back to black.

    I have XP Pro SP3, chip Pentium 4 3.4 GHz, 2.00 GB of RAM, 200 G double discs, each newly defragmented.

    Can someone help, please?

    I think that this part of the 16 Questions, but give particular attention to the property used in these projects. Please give all the details about them, especially the CODEC used.

    Now, a few other questions:

    (1.) because you are upgrading the machines/OS? No matter what, when you updated to CS4?

    2.) when was the last time you updated the driver of your vid card? If more than two weeks previously, the last being updated that.

    Good luck

    Hunt

  • Tried all your suggestions and always receive "Unable to connect" when using ANY search engine.

    Can't use any search engine of FF 40.0.3 on Macbook Pro model with 10.8.5 OS 9.2. Receive "Unable to connect" message when you try to use a search engine. Other than the search engine and Mozilla Web sites to connect properly. 40.0.3 on another Mac FireFox works fine without any problems.

    In addition, I can not access the FF "Get modules" page or the home page of Mozilla. Search engines will connect not their home page or the search bar. Problem just started. I had previously been upgrade and have resorted, FF 40.0.3 without problem when it was issued. Solutions of attempts included refresh FF, launch FF in safe mode, run with all plugins disabled, graphics hardware acceleration disabled. None of these fixed the issue.

    Had already tried your suggestions, without success, but has once again to be sure. Without success. However, I made a further exploration of my own and found out that IPv6 is set to "Link Local" only in my router. I have reset on 'Automatic', the router reset to update, and my problem was solved. So it was the IPv6 setting (unlikely) or the router reset (probably) that solved the problem, or it is your suggestions I tried and did not work, COMBINED with the router reset which solved the problem (quite possible).

    Thanks for the comments!

  • Unable to see the photo on gmail using firefox

    I'm unable to see the image of some mails in gmail using firefox, it works fine in Explorer

    IV checked exceptions in tools > Options > content: Load Images > Exceptions and it seems fine

    in gmail > mail in the Inbox and click the link "always display images of.

  • I can't see my iPHone on my mac pro when using Airdrop book, even though Airdrop is on both devices. Any suggestions?

    I can't see my iPHone on my mac pro when using Airdrop book, even though Airdrop is on both devices. Any suggestions?

    I assume that the Air Drop is enabled in the iPhone and that your devices are regarded as Favorites?

  • Satellite L650-11th the sound is distorted on my laptop when I see videos...

    I have a Satellite L650-11F.

    When I see videos on youtube the sound is distorted almost beyond recognition.

    I need help on this topic, I'm starting to get a little annoyed and the desperate by the time I've lost with this.

    CUMPS

    Please check if the TSRI (Intel Rapid Storage Technology Driver) must be undated as described here.

    + Audio / video multimedia file is stuttering.
    http://APS2.toshiba-tro.de/KB0/TSB12033I0001R01.htm

    TSRI could insist on the CPU and can cause the same problem.

  • analog/digital using canon hv-20 can see video import widow but nothing saved iMovie10.1

    analog/digital using canon hv-20 can see video in the import window but nothing saved in libraries after

    As you use your HV 20 analog to the digital pass-through mode, this can help.

    Camcorder passthrough import do not

  • I am importing video clips using my Canon XL1s in final cut pro.  See the video, I hear the audio until it is imported.  any suggestions

    I am importing video clips using my Canon XL1s in final cut pro.  See the video, I hear the audio until it is imported.  any suggestions?

    danobtwo wrote:

    See the video, I hear the audio until it is imported.  any suggestions?

    Do you mean during the import process?

    There is no FCP X parameter to change the way THAT DV is imported.

    I used to hear the audio import with Sony cameras but Canon may be a different story.

    If the imported files are OK, then it can be a thing of Protocol firewire Canon.

    Al

  • How can I fix the audio distortion when you make a video call using Windows Live Messenger

    When you make a video call using Windows Live Messenger I get audio distortion. How can I solve this problem

    Hello WayneMarkham,

    The best place to ask your question of Windows Live is inside Windows Live help forums. Experts specialize in all things, Windows Live, and would be delighted to help you with your questions. Please choose a product below to be redirected to the appropriate community:

    Windows Live Mail

    Windows Live Hotmail

    Windows Live Messenger

    Looking for a different product to Windows Live? Visit the home page Windows Live Help for the complete list of Windows Live forums to www.windowslivehelp.com.

  • Problem with the sync audio to video when you use Windows Movie Maker version 6.0

    I have a HP Slimline Pavillion S.3220.uk PC, using Windows Vista Edition Home Premium. I have problems with the audio video synchronization when using Windows Movie Maker, version 6.0, I 'get' raw AVCHD files to .wmv using voltaic HD.  I've noticed that the audio and video are out of sync, ONLY after the first thumbnail.  No indirect problem with videos, but when people talk to the camera, in case of DISASTER, as he is out of sync. I tried to reduce the resolution of 720 p and 540 p, and no solution to the problem. Any thoughts on the matter please?

    Hi Fabian119,

    Today, there are hundreds of audio and video codecs in use. Some were created by Microsoft, but the vast majority of codecs have been created by other companies, organizations or individuals. By default, the Windows operating system and the player includes a number of the most popular codecs, such as MP3, Windows Media Audio and Windows Media Video.

    There might be times, however, when you want to read the content that is compressed with a codec that does not include Windows or the default player (for example, a file compressed with the DivX video codec or the Ogg Vorbis audio codec). Because the player is extensible, in many cases you can download the necessary codec on the web for free or for a fee.

    You can visit the following links for more information on codecs:

    http://Windows.Microsoft.com/en-us/Windows-Vista/codecs-frequently-asked-questions

    You can also view the following link to download the audio file conversion programs and check if you can convert AVCHD to Mpeg.

    Convert music, videos and photos from one format to another

    http://Windows.Microsoft.com/en-us/Windows-Vista/convert-music-videos-and-pictures-from-one-format-to-another

    Hope this information is useful.

    Jeremy K
    Microsoft Answers Support Engineer
    Visit our Microsoft answers feedback Forum and let us know what you think.

    If this post can help solve your problem, please click the 'Mark as answer' or 'Useful' at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

Maybe you are looking for