Solved

Using JavaFx classes in a regular Java program

Posted on 2012-12-31
3
446 Views
Last Modified: 2013-01-01
I'm new to Java and found the NetBeans IDE to be more of my taste.  

With that context taken care of, I started up a simple project on the standard library (again, this is without much knowledge so I'm assuming default is standard, I can get to swing/awt stuff fine).

I have learned that the default sound access doesn't allow you to load mp3 files, and I am trying to avoid rolling my own api.  I did however, find that JavaFx has a class that specifically does this (Media) and would like to include it in the project.

First problem is, although I can open up a new JavaFx application, that's not what I want.  I want to import JavaFx and use that specific class only.  I am failing horribly to find a way to do that with NetBeans.

Second problem is, I'm looking for the Visual Studio equivalent of add reference - and do not know where to begin looking in NetBeans.
0
Comment
Question by:larrysy
3 Comments
 
LVL 24

Accepted Solution

by:
Tomas Helgi Johannsson earned 500 total points
ID: 38734348
Hi!

You could try open a new regular Java Application and then go to the Library section to Import the JavaFX library.
This is done automatically for you when you create a new JavaFX appliaction as well doing some other configuration that could be necessary.

Here are some JavaFX examples
http://www.java2s.com/Code/Java/JavaFX/MediaPlayer.htm
http://www.java2s.com/Code/Java/JavaFX/Media.htm
http://www.java2s.com/Code/Java/JavaFX/CatalogJavaFX.htm

For the second I think what you are looking for is in the Projects property section (just right click on your project and chose "Properties" )

Regards,
    Tomas Helgi
0
 
LVL 10

Expert Comment

by:Gregg
ID: 38734747
Have a look at this as well...

How to Play an MP3 File in Java

Plays an MP3 file using the JLayer MP3 library.
 http://www.javazoom.net/javalayer/sources.html
0
 

Author Closing Comment

by:larrysy
ID: 38735036
Thanks Tomas,

The answer to the second question is what ultimately led to me finding the necessary .java files to solve the first question.  For some reason JavaFx doesn't register as one of the Global Library packages.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
java set up 1 47
HashMap Vs TreeMap 12 49
java  and programming certification ? 4 65
Strange loading of website behaviour 3 23
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

25 Experts available now in Live!

Get 1:1 Help Now