Solved

Using JavaFx classes in a regular Java program

Posted on 2012-12-31
3
455 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 25

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Java exception bubble up 2 26
running on tomcat not jboss eap 7.0 3 55
Java array sort 10 63
Firefox and firebub 5 28
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
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…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses

751 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