I am using NetBeans and have two classes under the same package (main.java uses a swing container with a button. FXapp.java uses JavaFX to play media in a separate window). Clicking the button on main.java is supposed to launch FXapp.java in its own thread. However, using the code below I get the app to launch but my java app hangs. Any suggestions on how to launch JavaFX apps without this problem? Also (maybe related) I would then like the Java app to be able to pass values to show in a text box on the FXapp. This may be realted in that I am unable to get a handle to the FXapp.
Java Button code:
FXApp xvp = new FXapp();
The main method code in FXapp is:
public static void main(String[] args) throws Throwable {
    FXapp obj1 = new FXapp();
    new Thread(obj1).run();
    setRefObj(obj1);
}
The FXapp "run" method code:
public void run() {
    try {
        Application.launch();
    } catch (Throwable t) {
    }
}