how to open a new java file that contain JavaFX Content using Jbutton? I have a project to make a simulation generator,
I have one menu Jframe form, and I want to open another Jframe that integrated with JavaFX Content using Jbutton.
can you give me some source code to help me solve it.
here's my source code:
public class menu extends javax.swing.JFrame implements ActionListener { private static final long serialVersionUID = 1L; private Fx fx; /** * Creates new form menu */ public menu() { initComponents(); //super(); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setTitle("SIM-G (Simulation Generator)"); setSize(810, 610); setResizable(false); file_open.addActionListener(this); file_saveas.addActionListener(this); }
@Override public void setVisible(boolean B)/>{ if (B)/> { setLocationRelativeTo(null); Point point = getLocation(); setLocation(new Point(point.x, 0 - getHeight())); fx = new MoveToFx(point); fx.setComponent(this); super.setVisible(B)/>; fx.runFx(); } else { super.setVisible(B)/>; } }
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { }