Quantcast
Channel: JetBrains Developer Community : Thread List - IntelliJ IDEA Users
Viewing all articles
Browse latest Browse all 5661

Swing GUI error

$
0
0

Hi there, I'm trying to create java application using swing GUI. I've added JButton on the form, checked the "Custom Create" option in inspector, but the compiler throws an error.

Main.java

public class Main {

    public static void main(String[] args) {

        Form MyForm = new Form();

    }

}

 

Form.java

import javax.swing.*;

public class Form extends JFrame{

    private JButton button1;

    private void createUIComponent()

    {

        button1 = new JButton();

    }

}

 

Error:
forms: $PATH$/Form.form: Form contains components with Custom Create option but no createUIComponents() method

Viewing all articles
Browse latest Browse all 5661

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>