• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

Trouble with Netbeans and javabeans

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello guys,

Maybe you can give me some clues on what can be wrong:
I downloaded from Sun the Java Media Framework, which contains the mediaplayer javabean, but I can't use it in Netbeans. It let itself to be correctly installed into the palette manager, but when I try adding the item to a JFrame it shows the following error:

"Cannot load component class javax.media.bean.playerbean.MediaPlayer from JAR file:C\Documents and Settings\Alejandro\Desktop\jmf-2_1_1e-alljava\JMF-2.1.1e\lib\mediaplayer.jar.
The class must be compiled and must be on the classpath of the project this form belongs to."

But the jar contains compiled classes and it is registered in the compile-time libraries of the project...

Many thanks in advance for your help.

Cheers,
Alejandro
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you try adding the jar to runtime-library set as well? Create a library using the library manager, right-click libraries in the project window and select 'add library...'
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is a problem with MediaPlayer bean in NetBeans. It is already fixed in the new version (6.0).

http://www.netbeans.org/issues/show_bug.cgi?id=74002

For a workaround, add an empty JPanel instead and set its layout to BorderLayout. Then go to source code and in constructor after initComponents() call create the instance of the MediaPlayer and add it to the panel. So it would look like:

initComponents();
MediaPlayer mediaPlayer = new MediaPlayer();
jPanel1.add(mediaPlayer);
mediaPlayer.setMediaLocation("path to a file...");
mediaPlayer.start();
...

Note you need to add mediaplayer.jar and jmf.jar (or for sure all jars from the framework's lib folder) to the libraries of the project (in Project Properties).
[ January 05, 2007: Message edited by: Tomas Pavek ]
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic