BCS Java Swing Development

The current BCS Java development environment employs Eclipse Neon and the SwingBuilder plugin.

After the new java project was created click on the source folder and select New followed by the Other option until the SwingBuilder appears in the tree.

swb01

The following dialog appears and the FirstSwing name is keyed in the name field.

swb02

The SwingBuilder generated the code that appears below without coding a single line of code.

package swing;
 
import java.awt.EventQueue;
 
import javax.swing.JFrame;
import javax.swing.JTable;
import java.awt.BorderLayout;
 
public class FirstSwing {
 
	private JFrame frmFirstSwingApp;
 
	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					FirstSwing window = new FirstSwing();
					window.frmFirstSwingApp.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}
 
	/**
	 * Create the application.
	 */
	public FirstSwing() {
		initialize();
	}
 
	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize() {
		frmFirstSwingApp = new JFrame();
		frmFirstSwingApp.setTitle("First Swing App");
		frmFirstSwingApp.setBounds(100, 100, 450, 300);
		frmFirstSwingApp.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	}
 
}

Below is a screen shot of the SwingBuilder designer.swb03

To understand the layouts used by the swing designer click here.

A 32-bit executable program may be downloaded by clicking here.
A 64-bit executable program may be downloaded by clicking here.
The component documentation can be found by clicking here.
The source code may be found by clicking here.

Mr. Arch Brooks, Software Engineer, Brooks Computing Systems, LLC authored this article.