Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Using JavaFx classes in a regular Java program

Posted on 2012-12-31
3
Medium Priority
?
466 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 2000 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

Independent Software Vendors: 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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
In this post we will learn different types of Android Layout and some basics of an Android App.
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…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Suggested Courses

704 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