Running uiDesign form from Java Follow
Answered
I cannot run my form since version 2022.3. I think I mess something.
My main method:
public static void main(String[] args) {
JFrame frame = new JFrame("Morphing Editor");
EditorMorphing editorMorphing = new EditorMorphing();
editorMorphing.setMinimumSize(new Dimension(800, 600));
frame.setContentPane(editorMorphing);
frame.setMinimumSize(new Dimension(800, 600));
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JPanelPPMPreview preview1 = new JPanelPPMPreview(new Scene());
editorMorphing.preview = new JPanel();
editorMorphing.preview.add(preview1);
frame.pack();
frame.setVisible(true);
}
My class:
Initialization code is not generated.
public class EditorMorphing extends JPanel implements Runnable {
private static String directory;
private double dimXnew = 20;
private double dimYnew = 20;
private Model myModel = new Model();
private JButton goButton = new JButton("Go");
private JFormattedTextField dimX;
private JFormattedTextField dimY;
private JButton addAtPointXButton;
private JButton addAtPointYButton;
private JButton deleteAtPointXButton;
private JButton deleteAtPointYButton;
private JPanel inputLeft;
private JPanel inputRight;
private JPanel preview;
private JButton renderButton;
private JTextField textField1;
private JFormattedTextField a250FormattedTextField;
private JButton parcourirA = new JButton("Choisir image A");
private JButton parcourirB = new JButton("Choisir image B");
private JButton saveButton;
I don't know how to generate my forms with Gradle, and run my updated app?
Please sign in to leave a comment.
Please prepare and provide a small project sample and describe the steps you perform in order to run a form. The files can be uploaded at https://uploads.jetbrains.com/ (do not forget to specify the UploadID) Thank you!
new UI -> new "GUI Form with Class" in UIDesigner.
I also try "Dialog Form"
Upload id: 2022_12_09_29bnpB8wRZdxJe39GA84tx (files: UIDesignerMorphing.form, UIDesignerMorphing.java)
Then I don't know what to do. I tried create a main method, but I don't where GUI initialization should be done. I read it was done by compiler, but to say to Gradle "Compile the forms" and then "Run the app".
Should I use a plugin? Or create all by hands?
Please see if https://www.jetbrains.com/help/idea/creating-form-initialization-code.html helps.
GUI generation format can be configured under Settings/Preferences | Editor | GUI Designer | Generate GUI form
If this is not what you need, please provide a complete project, not only the form file. Thank you!
I put a zip here:
Upload id: 2022_12_09_dzkAsraP3ptV2T5jDWFnCJ (file: SampleProjectWithUI.zip)
I set GUI generation format to java source, but I cannot see the result code anywhere. Is there a Gradle task and dependency for that?