{"id":40888,"date":"2016-09-29T11:00:17","date_gmt":"2016-09-29T08:00:17","guid":{"rendered":"http:\/\/examples.javacodegeeks.com\/?p=40888"},"modified":"2016-09-27T14:13:07","modified_gmt":"2016-09-27T11:13:07","slug":"java-swingx-example","status":"publish","type":"post","link":"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/swing\/java-swingx-example\/","title":{"rendered":"Java Swingx Example"},"content":{"rendered":"<p>Swing is a GUI widget toolkit for Java. It is part of Oracle\u2019s Java Foundation Classes (JFC) \u2013 an API for providing a graphical user interface (GUI) for Java programs. Swing was developed to provide a more sophisticated set of GUI components than the earlier Abstract Window Toolkit (AWT). JAVA provides a rich set of libraries to create Graphical User Interface in platform independent way.<\/p>\n<h2>1. Introduction<\/h2>\n<p>Swing API is set of extensible GUI Components to ease developer\u2019s life to create JAVA based Front End\/ GUI Applications. It is build upon top of <code>AWT<\/code> API and acts as replacement of AWT API as it has almost every control corresponding to <code>AWT<\/code> controls. Swing component follows a Model-View-Controller architecture to fulfill the following criteria.<\/p>\n<ul>\n<li>A single API is to be sufficient to support multiple look and feel.<\/li>\n<li>API is to model driven so that highest level API is not required to have the data.<\/li>\n<li>API is to use the Java Bean model so that Builder Tools and IDE can provide better services to the developers to use it.<\/li>\n<\/ul>\n<h2>2. JAVA Swing<\/h2>\n<p>Unlike AWT, Java Swing provides platform-independent and lightweight components.\u00a0The javax.swing package provides classes for java swing API such as <code>JButton<\/code>, <code>JTextField<\/code>, <code>JTextArea<\/code>, <code>JRadioButton<\/code>, <code>JCheckbox<\/code>, <code>JMenu<\/code>, <code>JColorChooser<\/code> etc.<\/p>\n<h3>2.1 MVC Architecture<\/h3>\n<p>Swing API architecture follows loosely based MVC architecture in the following manner.<\/p>\n<ul>\n<li>A Model represents component\u2019s data.<\/li>\n<li>View represents visual representation of the component\u2019s data.<\/li>\n<li>Controller takes the input from the user on the view and reflects the changes in Component\u2019s data.<\/li>\n<li>Swing component have Model as a seperate element and View and Controller part are clubbed in User Interface elements. Using this way, Swing has pluggable look-and-feel architecture.<\/li>\n<\/ul>\n<p>Every user interface considers the following three main aspects:<\/p>\n<ul>\n<li><b>UI elements<\/b> : These are the core visual elements the user eventually sees and interacts with. GWT provides a huge list of widely used and common elements varying from basic to complex.<\/li>\n<li><b>Layouts<\/b>: They define how UI elements should be organized on the screen and provide a final look and feel to the GUI (Graphical User Interface).<\/li>\n<li><b>Behavior<\/b>: These are events which occur when the user interacts with UI elements.<\/li>\n<\/ul>\n<h3>2.2 Swing Features<\/h3>\n<ul>\n<li><b>Light Weight<\/b> \u2013 Swing component are independent of native Operating System\u2019s API as Swing API controls are rendered mostly using pure JAVA code instead of underlying operating system calls.<\/li>\n<li><b>Rich controls<\/b> \u2013 Swing provides a rich set of advanced controls like Tree, TabbedPane, slider, colorpicker, table controls.<\/li>\n<li><b>Highly Customizable<\/b> \u2013 Swing controls can be customized in very easy way as visual apperance is independent of internal representation.<\/li>\n<li><b>Pluggable look-and-feel<\/b>\u2013 SWING based GUI Application look and feel can be changed at run time based on available values.<\/li>\n<\/ul>\n<h3>2.3 Setup<\/h3>\n<p><b>Popular Java Editors<\/b>:<br \/>\nTo write your java programs you will need a text editor. There are even more sophisticated IDE available in the market. But for now, you can consider one of 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>Notepad: On Windows machine you can use any simple text editor like Notepad TextPad.<\/li>\n<li>NetBeans: is a Java IDE that is open source and free which can be downloaded from <a href=\"http:\/\/www.netbeans.org\/index.html\">http:\/\/www.netbeans.org\/index.html<\/a>.<\/li>\n<li>Eclipse: is also a java IDE developed by the eclipse open source community and can be downloaded from http:\/\/www.eclipse.org<\/li>\n<\/ul>\n<p><b>Prerequisite<\/b><br \/>\nThis example is developed on Eclipse therefore a compatible Eclipse IDE is required to be installed on the system.<br \/>\nWe also need WindowBuilder tool to be installed on Eclipse IDE for the easiness of the work. To learn how to install WindowBuilder tool please visit the Setup section 2.1 of the following link <a href=\"https:\/\/examples.javacodegeeks.com\/desktop-java\/swing\/java-swing-form-example\/\"><strong>click here<\/strong><\/a>.<\/p>\n<h3>2.4 Class and description<\/h3>\n<ul>\n<li><b>Component<\/b>: A Component is the abstract base class for the non menu user-interface controls of SWING. Component represents an object with graphical representation.<\/li>\n<li><b>Container<\/b>: A Container is a component that can contain other SWING components.<\/li>\n<li><b>JComponent<\/b>: A JComponent is a base class for all swing UI components. In order to use a swing component that inherits from JComponent, component must be in a containment hierarchy whose root is a top-level Swing container.<\/li>\n<\/ul>\n<h3>2.5 SWING UI Elements<\/h3>\n<ul>\n<ul>\n<li><b>JLabel<\/b>: A JLabel object is a component for placing text in a container.<\/li>\n<li><b>JButton<\/b> This class creates a labeled button.<\/li>\n<li><b>JColorChooser<\/b> A JColorChooser provides a pane of controls designed to allow a user to manipulate and select a color.<\/li>\n<li><b>JCheck Box<\/b> A JCheckBox is a graphical component that can be in either an on (true) or off (false) state.<\/li>\n<li><b>JRadioButton<\/b> The JRadioButton class is a graphical component that can be in either an on (true) or off (false) state. in a group.<\/li>\n<li><b>JList<\/b> A JList component presents the user with a scrolling list of text items.<\/li>\n<li><b>JComboBox<\/b> A JComboBox component presents the user with a to show up menu of choices.<\/li>\n<li><b>JTextField<\/b> A JTextField object is a text component that allows for the editing of a single line of text.<\/li>\n<li><b>JPasswordField<\/b> A JPasswordField object is a text component specialized for password entry.<\/li>\n<li><b>JTextArea<\/b> A JTextArea object is a text component that allows for the editing of a multiple lines of text.<\/li>\n<li><b>ImageIcon<\/b> A ImageIcon control is an implementation of the Icon interface that paints Icons from Images.<\/li>\n<li><b> JScrollbar<\/b> A Scrollbar control represents a scroll bar component in order to enable user to select from range of values.<\/li>\n<li><b>JOptionPane<\/b> JOptionPane provides set of standard dialog boxes that prompt users for a value or informs them of something.<\/li>\n<\/ul>\n<\/ul>\n<h2>3. Creating Swing Application<\/h2>\n<p>We will learn Swing basics through this example i.e, JavaSwingExample.java<\/p>\n<p>Code for JavaSwingExample.java<\/p>\n<p><span style=\"text-decoration: underline;\"><em>JavaSwingExample.java<\/em><\/span><\/p>\n<pre class=\"brush:java\">import javax.swing.*;         \r\n\r\n\r\npublic class JavaSwingExample{ \r\n\r\n    \/** \r\n\r\n     * Create the GUI and show it.  For thread safety, \r\n\r\n     * this method should be invoked from the \r\n \r\n     * event-dispatching thread. \r\n \r\n     *\/ \r\n \r\n    private static void createAndShowGUI() { \r\n\r\n        \/\/Make sure we have nice window decorations. \r\n\r\n        JFrame.setDefaultLookAndFeelDecorated(true); \r\n\r\n        \/\/Create and set up the window. \r\n \r\n        JFrame frame = new JFrame(\"JavaSwingExample\"); \r\n \r\n        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); \r\n \r\n        \/\/Add the ubiquitous \"Hello World\" label. \r\n\r\n        JLabel label = new JLabel(\"Hello World\"); \r\n\r\n        frame.getContentPane().add(label); \r\n\r\n       \/\/Display the window. \r\n\r\n       frame.pack(); \r\n\r\n       frame.setVisible(true); \r\n\r\n\r\n    } \r\n\r\n \r\n    public static void main(String[] args) { \r\n\r\n        \/\/Schedule a job for the event-dispatching thread: \r\n\r\n        \/\/creating and showing this application's GUI. \r\n\r\n\r\n        javax.swing.SwingUtilities.invokeLater(new Runnable() { \r\n\r\n           public void run() { \r\n\r\n              createAndShowGUI(); \r\n\r\n\r\n            } \r\n\r\n        }); \r\n\r\n    } \r\n \r\n} \r\n<\/pre>\n<p>This is one of the simplest Swing applications you can write. It doesn\u2019t do much, but the code demonstrates the basic code in every Swing program:<\/p>\n<p>1.Import the pertinent packages.<br \/>\n2.Set up a top-level container.<br \/>\n3.Display the container.<br \/>\n4.Be thread-safe.<\/p>\n<p>The first line imports the main Swing package:<\/p>\n<p><span style=\"text-decoration: underline;\"><em>JavaSwingExample.java<\/em><\/span><\/p>\n<pre class=\"brush:java\">import javax.swing.*;\r\n<\/pre>\n<p>This is the only package that JavaSwingExample needs. However, most Swing programs also need to import two AWT packages:<\/p>\n<p><span style=\"text-decoration: underline;\"><em>JavaSwingExample.java<\/em><\/span><\/p>\n<pre class=\"brush:java\">import java.awt.*; \r\nimport java.awt.event.*; \r\n<\/pre>\n<p>These packages are required because Swing components use the AWT infrastructure, including the AWT event model. The event model governs how a component reacts to events such as button clicks and mouse motion. You\u2019ll learn more about events in the upcoming section Handling Events (in the Creating a GUI with JFC\/Swing trail).<\/p>\n<p>Every program with a Swing GUI must has at least one top-level Swing container. A top-level Swing container provides the support Swing components need for painting and event handling. There are three commonly used top-level Swing containers: <code>JFrame<\/code>, <code>JDialog<\/code>, and (for applets) <code>JApplet<\/code>. Each <code>JFrame<\/code> object implements a single main window, and each <code>JDialog<\/code> implements a secondary window (a window dependent on another window). Each <code>JApplet<\/code> object implements an applet\u2019s display area within a browser window. (JApplet is covered in How to Make Applets(in the Creating a GUI with JFC\/Swing trail).)<\/p>\n<p>The JavaSwingExample example has only one top-level container, a <code>JFrame<\/code>. Imple\u00admented as an instance of the <code>JFrame<\/code> class, a frame is a window that, by default, has dec\u00adorations such as a border, a title, and buttons for iconifying and closing the window. Applications with a GUI typically use at least one frame.<\/p>\n<p>The Output of the code when executed will look like the one below.<\/p>\n<p><figure id=\"attachment_39185\" aria-describedby=\"caption-attachment-39185\" style=\"width: 890px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/07\/Sw1.jpg\"><img decoding=\"async\" class=\"size-full wp-image-39185\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/07\/Sw1.jpg\" alt=\"JAVA Swing Example\" width=\"890\" height=\"690\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/07\/Sw1.jpg 890w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/07\/Sw1-300x233.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/07\/Sw1-768x595.jpg 768w\" sizes=\"(max-width: 890px) 100vw, 890px\" \/><\/a><figcaption id=\"caption-attachment-39185\" class=\"wp-caption-text\">JAVA Swing Example<\/figcaption><\/figure><\/p>\n<h2>4. Download The Source Code<\/h2>\n<p>Here we have demonstrated how to build an application using Java Swing.<\/p>\n<div class=\"download\"><strong>Download<\/strong><br \/>\nYou can download the full source code of the eclipse project: <strong><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/09\/JavaSwingExample.zip\">JavaSwingExample<\/a><\/strong><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Swing is a GUI widget toolkit for Java. It is part of Oracle\u2019s Java Foundation Classes (JFC) \u2013 an API for providing a graphical user interface (GUI) for Java programs. Swing was developed to provide a more sophisticated set of GUI components than the earlier Abstract Window Toolkit (AWT). JAVA provides a rich set of &hellip;<\/p>\n","protected":false},"author":98,"featured_media":1204,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[58],"tags":[],"class_list":["post-40888","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-swing"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Java Swingx Example - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"Swing is a GUI widget toolkit for Java. It is part of Oracle\u2019s Java Foundation Classes (JFC) \u2013 an API for providing a graphical user interface (GUI) for\" \/>\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\/swing\/java-swingx-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Java Swingx Example - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"Swing is a GUI widget toolkit for Java. It is part of Oracle\u2019s Java Foundation Classes (JFC) \u2013 an API for providing a graphical user interface (GUI) for\" \/>\n<meta property=\"og:url\" content=\"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/swing\/java-swingx-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:author\" content=\"https:\/\/www.facebook.com\/jyoti.jha.9256\" \/>\n<meta property=\"article:published_time\" content=\"2016-09-29T08:00:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-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=\"Jyoti Jha\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jyoti Jha\" \/>\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\/swing\/java-swingx-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/swing\/java-swingx-example\/\"},\"author\":{\"name\":\"Jyoti Jha\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/7dcd033e37def0d21806e891845d89b7\"},\"headline\":\"Java Swingx Example\",\"datePublished\":\"2016-09-29T08:00:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/swing\/java-swingx-example\/\"},\"wordCount\":1221,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/swing\/java-swingx-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg\",\"articleSection\":[\"swing\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/swing\/java-swingx-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/swing\/java-swingx-example\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/swing\/java-swingx-example\/\",\"name\":\"Java Swingx Example - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/swing\/java-swingx-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/swing\/java-swingx-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg\",\"datePublished\":\"2016-09-29T08:00:17+00:00\",\"description\":\"Swing is a GUI widget toolkit for Java. It is part of Oracle\u2019s Java Foundation Classes (JFC) \u2013 an API for providing a graphical user interface (GUI) for\",\"breadcrumb\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/swing\/java-swingx-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/swing\/java-swingx-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/swing\/java-swingx-example\/#primaryimage\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg\",\"width\":150,\"height\":150,\"caption\":\"Bipartite Graph\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/swing\/java-swingx-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\":\"swing\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/java-development\/desktop-java\/swing\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Java Swingx 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\/7dcd033e37def0d21806e891845d89b7\",\"name\":\"Jyoti Jha\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/Jyoti-Jha-96x96.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/Jyoti-Jha-96x96.jpg\",\"caption\":\"Jyoti Jha\"},\"description\":\"Jyoti is a tech enthusiast and is an avid programmer. She holds a post graduation degree in (M.Tech) Computer Science Engineering from Thapar Univeristy, Patiala, India. Post her graduate studies, she has worked in Software companies such as SLK Software and Aricent, India as Software Engineer in various projects primarily in the field of Requirement analysis and design, implementing new algorithms in C++ and JAVA used in ISDN network and designing databases and. She is inquisitive about socio economic reforms as well as advancement in technical fronts and keep herself informed with TED talks and various blogs.\",\"sameAs\":[\"https:\/\/www.javacodegeeks.com\/\",\"https:\/\/www.facebook.com\/jyoti.jha.9256\"],\"url\":\"https:\/\/examples.javacodegeeks.com\/author\/jyoti-jha\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Java Swingx Example - Java Code Geeks","description":"Swing is a GUI widget toolkit for Java. It is part of Oracle\u2019s Java Foundation Classes (JFC) \u2013 an API for providing a graphical user interface (GUI) for","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\/swing\/java-swingx-example\/","og_locale":"en_US","og_type":"article","og_title":"Java Swingx Example - Java Code Geeks","og_description":"Swing is a GUI widget toolkit for Java. It is part of Oracle\u2019s Java Foundation Classes (JFC) \u2013 an API for providing a graphical user interface (GUI) for","og_url":"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/swing\/java-swingx-example\/","og_site_name":"Examples Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_author":"https:\/\/www.facebook.com\/jyoti.jha.9256","article_published_time":"2016-09-29T08:00:17+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg","type":"image\/jpeg"}],"author":"Jyoti Jha","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Jyoti Jha","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/swing\/java-swingx-example\/#article","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/swing\/java-swingx-example\/"},"author":{"name":"Jyoti Jha","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/7dcd033e37def0d21806e891845d89b7"},"headline":"Java Swingx Example","datePublished":"2016-09-29T08:00:17+00:00","mainEntityOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/swing\/java-swingx-example\/"},"wordCount":1221,"commentCount":0,"publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/swing\/java-swingx-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg","articleSection":["swing"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/swing\/java-swingx-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/swing\/java-swingx-example\/","url":"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/swing\/java-swingx-example\/","name":"Java Swingx Example - Java Code Geeks","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/swing\/java-swingx-example\/#primaryimage"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/swing\/java-swingx-example\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg","datePublished":"2016-09-29T08:00:17+00:00","description":"Swing is a GUI widget toolkit for Java. It is part of Oracle\u2019s Java Foundation Classes (JFC) \u2013 an API for providing a graphical user interface (GUI) for","breadcrumb":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/swing\/java-swingx-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/swing\/java-swingx-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/swing\/java-swingx-example\/#primaryimage","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2012\/12\/java-logo.jpg","width":150,"height":150,"caption":"Bipartite Graph"},{"@type":"BreadcrumbList","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/desktop-java\/swing\/java-swingx-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":"swing","item":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/desktop-java\/swing\/"},{"@type":"ListItem","position":5,"name":"Java Swingx 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\/7dcd033e37def0d21806e891845d89b7","name":"Jyoti Jha","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/Jyoti-Jha-96x96.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2016\/05\/Jyoti-Jha-96x96.jpg","caption":"Jyoti Jha"},"description":"Jyoti is a tech enthusiast and is an avid programmer. She holds a post graduation degree in (M.Tech) Computer Science Engineering from Thapar Univeristy, Patiala, India. Post her graduate studies, she has worked in Software companies such as SLK Software and Aricent, India as Software Engineer in various projects primarily in the field of Requirement analysis and design, implementing new algorithms in C++ and JAVA used in ISDN network and designing databases and. She is inquisitive about socio economic reforms as well as advancement in technical fronts and keep herself informed with TED talks and various blogs.","sameAs":["https:\/\/www.javacodegeeks.com\/","https:\/\/www.facebook.com\/jyoti.jha.9256"],"url":"https:\/\/examples.javacodegeeks.com\/author\/jyoti-jha\/"}]}},"_links":{"self":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/40888","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\/98"}],"replies":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=40888"}],"version-history":[{"count":0,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/40888\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media\/1204"}],"wp:attachment":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=40888"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=40888"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=40888"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}