Solved

Using JavaFx classes in a regular Java program

Posted on 2012-12-31
3
462 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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses

622 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