I'm trying to create a utility method to create and show a JavaFx Application with a Pane as the parameter. It doesn't have to be the "right" way to run a javaFx application as it is really just a method for quickly testing how a pane looks.
Here is the java swing equivalent of what I'm trying to do:
The utility class with a method to create and show a JFrame with a passed in component (ie. JPanel):
public class FrameUtility {
public static void createAndShowJFrame(JComponent component) {
JFrame frame = new JFrame();
frame.add( component );
frame.pack();
frame.setVisible(true);
}
}
Example usage:
public class CustomPanel extends JPanel {
//Custom Panel Code....
//Test method
public static void main(String[] args) {
FrameUtility.createAndShowJFrame( new CustomPanel() );
}
}
Is this possible in JavaFx?