{"id":30773,"date":"2015-12-31T15:00:36","date_gmt":"2015-12-31T13:00:36","guid":{"rendered":"http:\/\/examples.javacodegeeks.com\/?p=30773"},"modified":"2015-12-30T14:11:24","modified_gmt":"2015-12-30T12:11:24","slug":"intellij-gui-designer-example","status":"publish","type":"post","link":"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/ide\/intellij-gui-designer-example\/","title":{"rendered":"IntelliJ GUI Designer Example"},"content":{"rendered":"<p>This example demonstrates how you can utilize IntelliJ GUI Designer to create a graphical user interface that is based on the Swing library components. It must be noted that IntelliJ does not support modeling of non-swing components.<\/p>\n<p>When working with the GUI Designer you operate in design view where you are able to drag and drop swing components within the context of a form. All GUI information related to the form are stored in a file with .form extension. When creating a GUI component in IntelliJ you begin by creating a form, this form serves as a container that groups all other components that are required for your application. When a form is created, IntelliJ provides you with an option of also creating a Bound Class. A Bound Class is a Java class that is bound to a form and contains auto-generated code that reflects the components that are added on the form. The bound class can be updated at any point to add specific behavior on the components that have been added in the form.<\/p>\n<p>In this example we shall\u00a0create a simple calculator application to demonstrate how you work with the GUI Designer.<\/p>\n<h2>1. Creating a new project<\/h2>\n<p>Launch IntelliJ and create a new project called: <strong>CalculatorGUI<\/strong>.<\/p>\n<p><figure id=\"attachment_30876\" aria-describedby=\"caption-attachment-30876\" style=\"width: 640px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/new-project1.jpg\"><img decoding=\"async\" class=\"size-full wp-image-30876\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/new-project1.jpg\" alt=\"New Project\" width=\"640\" height=\"480\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/new-project1.jpg 640w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/new-project1-300x225.jpg 300w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><figcaption id=\"caption-attachment-30876\" class=\"wp-caption-text\">New Project<\/figcaption><\/figure><\/p>\n<p>Create a new package in the src\/java directory called <strong>com.javacodegeeks.example<\/strong><\/p>\n<p>Right-click the new package and select -&gt; <strong>New<\/strong> -&gt; <strong>GUI Form<\/strong><\/p>\n<p><figure id=\"attachment_30883\" aria-describedby=\"caption-attachment-30883\" style=\"width: 700px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/new-gui-form.jpg\"><img decoding=\"async\" class=\"size-full wp-image-30883\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/new-gui-form.jpg\" alt=\"Create GUI Form\" width=\"700\" height=\"542\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/new-gui-form.jpg 700w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/new-gui-form-300x232.jpg 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><\/a><figcaption id=\"caption-attachment-30883\" class=\"wp-caption-text\">Create GUI Form<\/figcaption><\/figure><\/p>\n<p>In the New GUI Form Window populate the following:<\/p>\n<ul>\n<li><strong>Form Name<\/strong>: Calculator<\/li>\n<li><strong>Base layout manager<\/strong>: GridLayoutManager(IntelliJ)<\/li>\n<li><strong>Create bound class<\/strong>:selected<\/li>\n<li><strong>Class name<\/strong>: Calculator<\/li>\n<\/ul>\n<p>Clicking Ok on the GUI Form window once its populated, should display design-time graphical view as seen below:<\/p>\n<p><figure id=\"attachment_30960\" aria-describedby=\"caption-attachment-30960\" style=\"width: 800px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/new-project-design-view1.jpg\"><img decoding=\"async\" class=\"size-full wp-image-30960\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/new-project-design-view1.jpg\" alt=\"Design view\" width=\"800\" height=\"319\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/new-project-design-view1.jpg 800w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/new-project-design-view1-300x120.jpg 300w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><figcaption id=\"caption-attachment-30960\" class=\"wp-caption-text\">Design view<\/figcaption><\/figure><\/p>\n<h2>2. Graphical view<\/h2>\n<p>The graphical view allows you to drag and drop swing components to be added on the Form of the application. When any file that has a <code>.form<\/code> extension has been selected into the view, the following windows are displayed:<\/p>\n<ol>\n<li>Component tree &#8211; displays the hierarchical view of the components that have been added on the form.<\/li>\n<li>Property editor\u00a0&#8211; displays the properties of the components added on the form which can be edited.<\/li>\n<li>Design area &#8211; the graphical view of the form. Components are dragged into this area\u00a0to be added on the form.<\/li>\n<li>Palette &#8211; contains all available swing components that can be selected to be added on the form.<\/li>\n<\/ol>\n<h2>3. Creating the GUI<\/h2>\n<h3>3.1 Add Results display<\/h3>\n<p>Drag the <code>JTextField<\/code> from the palette and drop it in the design area. Update the field name in the property editor to read: <strong>results<\/strong><\/p>\n<p><figure id=\"attachment_30984\" aria-describedby=\"caption-attachment-30984\" style=\"width: 800px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/results-component.jpg\"><img decoding=\"async\" class=\"size-full wp-image-30984\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/results-component.jpg\" alt=\"Adding JTextField\" width=\"800\" height=\"411\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/results-component.jpg 800w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/results-component-300x154.jpg 300w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><figcaption id=\"caption-attachment-30984\" class=\"wp-caption-text\">Adding JTextField<\/figcaption><\/figure><\/p>\n<p>When you add the <code>JTextField<\/code> the <code>Vertical Spacer<\/code> also gets automatically added.<\/p>\n<h3>3.2 Add Buttons<\/h3>\n<p>Drag the <code>JButton<\/code> from the palette and drop it in the design area. Add the JButton on the left-hand side of the <code>Vertical Spacer<\/code>. As you release the mouse a tooltip will be displayed showing <code>JPanel(Row 1, Before Col 0)<\/code>, which indicates the position where the component will be placed in the grid. Repeat the process to add 4 buttons in the same row. Update the properties of the 4 buttons to the following:<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<ul>\n<li><strong>button1<\/strong>: field name change to <strong>clearBtn<\/strong>, \u00a0Text change to<strong> AC<\/strong><\/li>\n<li><strong>button2<\/strong>: field name change to <strong>signBtn<\/strong>. Text change to <strong>+\/-<\/strong><\/li>\n<li><strong>button3<\/strong>: field name change to <strong>percentBtn<\/strong>.Text change to <strong>%<\/strong><\/li>\n<li><strong>button4<\/strong>: field name change to <strong>divideBtn<\/strong>. Text change to <strong>\/<\/strong><\/li>\n<\/ul>\n<p><figure id=\"attachment_30986\" aria-describedby=\"caption-attachment-30986\" style=\"width: 797px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/add-buttons.jpg\"><img decoding=\"async\" class=\"size-full wp-image-30986\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/add-buttons.jpg\" alt=\"Add Buttons\" width=\"797\" height=\"429\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/add-buttons.jpg 797w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/add-buttons-300x160.jpg 300w\" sizes=\"(max-width: 797px) 100vw, 797px\" \/><\/a><figcaption id=\"caption-attachment-30986\" class=\"wp-caption-text\">Add Buttons<\/figcaption><\/figure><\/p>\n<p>Add the rest of the buttons, in total should have 5 rows and 4 columns populated with buttons. You can now remove the <code>Vertical Spacer<\/code>.<\/p>\n<p><figure id=\"attachment_30994\" aria-describedby=\"caption-attachment-30994\" style=\"width: 440px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/calculator-design.jpg\"><img decoding=\"async\" class=\"size-full wp-image-30994\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/calculator-design.jpg\" alt=\"Calculator design view\" width=\"440\" height=\"414\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/calculator-design.jpg 440w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/calculator-design-300x282.jpg 300w\" sizes=\"(max-width: 440px) 100vw, 440px\" \/><\/a><figcaption id=\"caption-attachment-30994\" class=\"wp-caption-text\">Calculator design view<\/figcaption><\/figure><\/p>\n<p>Select the <code>JPanel<\/code> in the Component tree of the form view and update the field name property to <code>calculatorView<\/code>.\u00a0Clicking on the <code>Calculator.java<\/code> should now have the following fields inserted:<\/p>\n<p><span style=\"text-decoration: underline\"><em>Calculator.java<\/em><\/span><\/p>\n<pre class=\"brush:java\">package com.javacodegeeks.example;\r\n\r\nimport javax.swing.*;\r\n\r\npublic class Calculator {\r\n    private JTextField resultsTxt;\r\n    private JButton clearBtn;\r\n    private JButton signBtn;\r\n    private JButton percentBtn;\r\n    private JButton divideBtn;\r\n    private JButton sevenBtn;\r\n    private JButton eightBtn;\r\n    private JButton nineBtn;\r\n    private JButton multiplyBtn;\r\n    private JButton fourBtn;\r\n    private JButton fiveBtn;\r\n    private JButton sixBtn;\r\n    private JButton minusBtn;\r\n    private JButton oneBtn;\r\n    private JButton twoBtn;\r\n    private JButton threeBtn;\r\n    private JButton addBtn;\r\n    private JButton zeroBtn;\r\n    private JButton equalBtn;\r\n    private JButton digitBtn;\r\n    private JPanel calculatorView;\r\n}\r\n<\/pre>\n<h2>4. Making the form functional<\/h2>\n<p>In order for the form to be functional it requires a runtime frame to be created. We will create the <code>main()<\/code> method that will will be responsible for creating and disposing the runtime frame.<\/p>\n<p>In the code editor of\u00a0<code>Calculator.java<\/code>\u00a0file select -&gt; Generate&#8230; -&gt; Form <code>main()<\/code><\/p>\n<p>The following code gets generated:<\/p>\n<p><span style=\"text-decoration: underline\"><em>Calculator.java main method<\/em><\/span><\/p>\n<pre class=\"brush:java\">public static void main(String[] args) {\r\n        JFrame frame = new JFrame(\"Calculator\");\r\n        frame.setContentPane(new Calculator().calculatorView);\r\n        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n        frame.pack();\r\n        frame.setVisible(true);\r\n    }\r\n<\/pre>\n<p>Now we create an enum for handling the different calculator operations. The constructor of the enum takes in a function in this case <code>DoubleBinaryOperator<\/code> (provided in Java 8) which represents an operation on two double-valued operands that produces a double-valued result.<\/p>\n<p><span style=\"text-decoration: underline\"><em>Operation.java<\/em><\/span><\/p>\n<pre class=\"brush:java\">package com.javacodegeeks.example;\r\n\r\nimport java.util.function.DoubleBinaryOperator;\r\n\r\npublic enum Operation {\r\n    ADDITION((x, y) -&gt; x+y),\r\n    SUBTRACTION((x, y) -&gt; x-y),\r\n    DIVISION((x, y) -&gt; x\/y),\r\n    MULTIPLICATION((x, y) -&gt; x*y),\r\n    PERCENTAGE((x, y) -&gt; x%y);\r\n\r\n\r\n    private DoubleBinaryOperator operator;\r\n\r\n    Operation(DoubleBinaryOperator operator) {\r\n       this.operator = operator;\r\n    }\r\n\r\n    public DoubleBinaryOperator getOperator() {\r\n        return operator;\r\n    }\r\n}\r\n<\/pre>\n<h2>5. Putting everything together<\/h2>\n<p>Now we add action listeners that will be triggered when the buttons of the calculator get clicked. We then bind the buttons to those action listeners.<\/p>\n<p><span style=\"text-decoration: underline\"><em>Calculator.java<\/em><\/span><\/p>\n<pre class=\"brush:java;wrap-lines:false\">\r\n\r\npackage com.javacodegeeks.example;\r\n\r\nimport javax.swing.*;\r\nimport java.awt.event.ActionEvent;\r\nimport java.awt.event.ActionListener;\r\n\r\npublic class Calculator {\r\n    private JTextField resultsTxt;\r\n    private JButton clearBtn;\r\n    private JButton signBtn;\r\n    private JButton percentBtn;\r\n    private JButton divideBtn;\r\n    private JButton sevenBtn;\r\n    private JButton eightBtn;\r\n    private JButton nineBtn;\r\n    private JButton multiplyBtn;\r\n    private JButton fourBtn;\r\n    private JButton fiveBtn;\r\n    private JButton sixBtn;\r\n    private JButton minusBtn;\r\n    private JButton oneBtn;\r\n    private JButton twoBtn;\r\n    private JButton threeBtn;\r\n    private JButton addBtn;\r\n    private JButton zeroBtn;\r\n    private JButton equalBtn;\r\n    private JButton digitBtn;\r\n    private JPanel calculatorView;\r\n    private Double leftOperand;\r\n    private Double rightOperand;\r\n    private Operation calcOperation;\r\n\r\n    public Calculator() {\r\n\r\n        sevenBtn.addActionListener(new NumberBtnClicked(sevenBtn.getText()));\r\n        eightBtn.addActionListener(new NumberBtnClicked(eightBtn.getText()));\r\n        nineBtn.addActionListener(new NumberBtnClicked(nineBtn.getText()));\r\n        fourBtn.addActionListener(new NumberBtnClicked(fourBtn.getText()));\r\n        fiveBtn.addActionListener(new NumberBtnClicked(fiveBtn.getText()));\r\n        sixBtn.addActionListener(new NumberBtnClicked(sixBtn.getText()));\r\n        oneBtn.addActionListener(new NumberBtnClicked(oneBtn.getText()));\r\n        twoBtn.addActionListener(new NumberBtnClicked(twoBtn.getText()));\r\n        threeBtn.addActionListener(new NumberBtnClicked(threeBtn.getText()));\r\n        zeroBtn.addActionListener(new NumberBtnClicked(zeroBtn.getText()));\r\n\r\n        percentBtn.addActionListener(new OperationBtnClicked(Operation.PERCENTAGE));\r\n        multiplyBtn.addActionListener(new OperationBtnClicked(Operation.MULTIPLICATION));\r\n        divideBtn.addActionListener(new OperationBtnClicked(Operation.DIVISION));\r\n        minusBtn.addActionListener(new OperationBtnClicked(Operation.SUBTRACTION));\r\n        addBtn.addActionListener(new OperationBtnClicked(Operation.ADDITION));\r\n        equalBtn.addActionListener(new EqualBtnClicked());\r\n        clearBtn.addActionListener(new ClearBtnClicked());\r\n        signBtn.addActionListener(new SignBtnClicked());\r\n        digitBtn.addActionListener(new DigitBtnClicked());\r\n    }\r\n\r\n    private class NumberBtnClicked implements ActionListener {\r\n\r\n        private String value;\r\n\r\n        public NumberBtnClicked(String value) {\r\n            this.value = value;\r\n        }\r\n\r\n        @Override\r\n        public void actionPerformed(ActionEvent e) {\r\n            if(leftOperand == null || leftOperand == 0.0) {\r\n                value = resultsTxt.getText() + value;\r\n            }else{\r\n                rightOperand = Double.valueOf(value);\r\n            }\r\n            resultsTxt.setText(value);\r\n\r\n        }\r\n    }\r\n\r\n    private class OperationBtnClicked implements ActionListener {\r\n\r\n        private Operation operation;\r\n\r\n        public OperationBtnClicked(Operation operation) {\r\n            this.operation = operation;\r\n        }\r\n\r\n        @Override\r\n        public void actionPerformed(ActionEvent e) {\r\n            calcOperation = operation;\r\n            leftOperand = Double.valueOf(resultsTxt.getText());\r\n        }\r\n    }\r\n\r\n    private class ClearBtnClicked implements ActionListener {\r\n\r\n        @Override\r\n        public void actionPerformed(ActionEvent e) {\r\n            resultsTxt.setText(\"\");\r\n            leftOperand = 0.0;\r\n            rightOperand = 0.0;\r\n        }\r\n    }\r\n\r\n    private class DigitBtnClicked implements ActionListener {\r\n\r\n        @Override\r\n        public void actionPerformed(ActionEvent e) {\r\n            resultsTxt.setText(resultsTxt.getText() + \".\");\r\n\r\n        }\r\n    }\r\n\r\n    private class EqualBtnClicked implements ActionListener {\r\n\r\n        @Override\r\n        public void actionPerformed(ActionEvent e) {\r\n            Double output = calcOperation.getOperator().applyAsDouble(leftOperand, rightOperand);\r\n            resultsTxt.setText(output%1==0?String.valueOf(output.intValue()):String.valueOf(output));\r\n            leftOperand = 0.0;\r\n            rightOperand = 0.0;\r\n        }\r\n    }\r\n\r\n    private class SignBtnClicked implements ActionListener {\r\n\r\n        @Override\r\n        public void actionPerformed(ActionEvent e) {\r\n            resultsTxt.setText(\"-\"+ resultsTxt.getText());\r\n        }\r\n    }\r\n\r\n    public static void main(String[] args) {\r\n        JFrame frame = new JFrame(\"Calculator\");\r\n        frame.setContentPane(new Calculator().calculatorView);\r\n        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r\n        frame.pack();\r\n        frame.setVisible(true);\r\n    }\r\n}\r\n\r\n<\/pre>\n<h2>6. Running your application<\/h2>\n<p>Right-click <code>Calculator.java<\/code> and select Run <code>Calculator.main()<\/code><\/p>\n<p><figure id=\"attachment_31010\" aria-describedby=\"caption-attachment-31010\" style=\"width: 320px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/calculator-final.jpg\"><img decoding=\"async\" class=\"size-full wp-image-31010\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/calculator-final.jpg\" alt=\"Calculator\" width=\"320\" height=\"276\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/calculator-final.jpg 320w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/calculator-final-300x259.jpg 300w\" sizes=\"(max-width: 320px) 100vw, 320px\" \/><\/a><figcaption id=\"caption-attachment-31010\" class=\"wp-caption-text\">Calculator<\/figcaption><\/figure><\/p>\n<h2>7. Download the IntelliJ Project<\/h2>\n<p>This was an example of using IntelliJ GUI Designer to create a Swing Calculator.<\/p>\n<div class=\"download\"><strong>Download<\/strong><\/p>\n<p>You can download the full source code of this example here: <a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/CalculatorGUI.zip\"><strong>CalculatorGUI<\/strong><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>This example demonstrates how you can utilize IntelliJ GUI Designer to create a graphical user interface that is based on the Swing library components. It must be noted that IntelliJ does not support modeling of non-swing components. When working with the GUI Designer you operate in design view where you are able to drag and &hellip;<\/p>\n","protected":false},"author":68,"featured_media":29828,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[660],"tags":[1291,212,1058],"class_list":["post-30773","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ide","tag-intellij","tag-java-basics-2","tag-swing"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>IntelliJ GUI Designer Example - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"This example demonstrates how you can utilize IntelliJ GUI Designer to create a graphical user interface that is based on the Swing library components. It\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/ide\/intellij-gui-designer-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"IntelliJ GUI Designer Example - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"This example demonstrates how you can utilize IntelliJ GUI Designer to create a graphical user interface that is based on the Swing library components. It\" \/>\n<meta property=\"og:url\" content=\"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/ide\/intellij-gui-designer-example\/\" \/>\n<meta property=\"og:site_name\" content=\"Examples Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2015-12-31T13:00:36+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/jetbrains-intellijidea-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Ndibulele Mqoboli\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@ndibuleleZA\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Ndibulele Mqoboli\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/ide\/intellij-gui-designer-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/ide\/intellij-gui-designer-example\/\"},\"author\":{\"name\":\"Ndibulele Mqoboli\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/9921207b48b7d2b090da6b49a254adb2\"},\"headline\":\"IntelliJ GUI Designer Example\",\"datePublished\":\"2015-12-31T13:00:36+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/ide\/intellij-gui-designer-example\/\"},\"wordCount\":817,\"commentCount\":4,\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/ide\/intellij-gui-designer-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/jetbrains-intellijidea-logo.jpg\",\"keywords\":[\"intellij\",\"java basics\",\"swing\"],\"articleSection\":[\"IDE\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/ide\/intellij-gui-designer-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/ide\/intellij-gui-designer-example\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/ide\/intellij-gui-designer-example\/\",\"name\":\"IntelliJ GUI Designer Example - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/ide\/intellij-gui-designer-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/ide\/intellij-gui-designer-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/jetbrains-intellijidea-logo.jpg\",\"datePublished\":\"2015-12-31T13:00:36+00:00\",\"description\":\"This example demonstrates how you can utilize IntelliJ GUI Designer to create a graphical user interface that is based on the Swing library components. It\",\"breadcrumb\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/ide\/intellij-gui-designer-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/ide\/intellij-gui-designer-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/ide\/intellij-gui-designer-example\/#primaryimage\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/jetbrains-intellijidea-logo.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/jetbrains-intellijidea-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/ide\/intellij-gui-designer-example\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/examples.javacodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java Development\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/java-development\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Desktop Java\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/java-development\/desktop-java\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"IDE\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/java-development\/desktop-java\/ide\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"IntelliJ GUI Designer Example\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Examples and Code Snippets\",\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/javacodegeeks\",\"https:\/\/x.com\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/9921207b48b7d2b090da6b49a254adb2\",\"name\":\"Ndibulele Mqoboli\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/11\/Ndibulele-Mqoboli.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/11\/Ndibulele-Mqoboli.jpg\",\"caption\":\"Ndibulele Mqoboli\"},\"description\":\"Ndibulele is a software development professional with over 10 years experience writing software and leading development teams. He has worked for blue chip companies in Telecommunications, Insurance and Investment Banking sectors and has comprehensive experience in delivering large-scale projects. He is very passionate about software craftsmanship.\",\"sameAs\":[\"http:\/\/www.javacodegeeks.com\/\",\"https:\/\/x.com\/ndibuleleZA\"],\"url\":\"https:\/\/examples.javacodegeeks.com\/author\/ndibulele-mqoboli\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"IntelliJ GUI Designer Example - Java Code Geeks","description":"This example demonstrates how you can utilize IntelliJ GUI Designer to create a graphical user interface that is based on the Swing library components. It","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/ide\/intellij-gui-designer-example\/","og_locale":"en_US","og_type":"article","og_title":"IntelliJ GUI Designer Example - Java Code Geeks","og_description":"This example demonstrates how you can utilize IntelliJ GUI Designer to create a graphical user interface that is based on the Swing library components. It","og_url":"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/ide\/intellij-gui-designer-example\/","og_site_name":"Examples Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2015-12-31T13:00:36+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/jetbrains-intellijidea-logo.jpg","type":"image\/jpeg"}],"author":"Ndibulele Mqoboli","twitter_card":"summary_large_image","twitter_creator":"@ndibuleleZA","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Ndibulele Mqoboli","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/ide\/intellij-gui-designer-example\/#article","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/ide\/intellij-gui-designer-example\/"},"author":{"name":"Ndibulele Mqoboli","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/9921207b48b7d2b090da6b49a254adb2"},"headline":"IntelliJ GUI Designer Example","datePublished":"2015-12-31T13:00:36+00:00","mainEntityOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/ide\/intellij-gui-designer-example\/"},"wordCount":817,"commentCount":4,"publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/ide\/intellij-gui-designer-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/jetbrains-intellijidea-logo.jpg","keywords":["intellij","java basics","swing"],"articleSection":["IDE"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/ide\/intellij-gui-designer-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/ide\/intellij-gui-designer-example\/","url":"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/ide\/intellij-gui-designer-example\/","name":"IntelliJ GUI Designer Example - Java Code Geeks","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/ide\/intellij-gui-designer-example\/#primaryimage"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/ide\/intellij-gui-designer-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/jetbrains-intellijidea-logo.jpg","datePublished":"2015-12-31T13:00:36+00:00","description":"This example demonstrates how you can utilize IntelliJ GUI Designer to create a graphical user interface that is based on the Swing library components. It","breadcrumb":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/ide\/intellij-gui-designer-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/ide\/intellij-gui-designer-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/ide\/intellij-gui-designer-example\/#primaryimage","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/jetbrains-intellijidea-logo.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/12\/jetbrains-intellijidea-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/ide\/intellij-gui-designer-example\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/examples.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java Development","item":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/"},{"@type":"ListItem","position":3,"name":"Desktop Java","item":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/desktop-java\/"},{"@type":"ListItem","position":4,"name":"IDE","item":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/desktop-java\/ide\/"},{"@type":"ListItem","position":5,"name":"IntelliJ GUI Designer Example"}]},{"@type":"WebSite","@id":"https:\/\/examples.javacodegeeks.com\/#website","url":"https:\/\/examples.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Examples and Code Snippets","publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/examples.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/examples.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/9921207b48b7d2b090da6b49a254adb2","name":"Ndibulele Mqoboli","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/11\/Ndibulele-Mqoboli.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/11\/Ndibulele-Mqoboli.jpg","caption":"Ndibulele Mqoboli"},"description":"Ndibulele is a software development professional with over 10 years experience writing software and leading development teams. He has worked for blue chip companies in Telecommunications, Insurance and Investment Banking sectors and has comprehensive experience in delivering large-scale projects. He is very passionate about software craftsmanship.","sameAs":["http:\/\/www.javacodegeeks.com\/","https:\/\/x.com\/ndibuleleZA"],"url":"https:\/\/examples.javacodegeeks.com\/author\/ndibulele-mqoboli\/"}]}},"_links":{"self":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/30773","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/users\/68"}],"replies":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=30773"}],"version-history":[{"count":0,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/30773\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media\/29828"}],"wp:attachment":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=30773"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=30773"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=30773"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}