Created
January 9, 2014 02:40
-
-
Save mfullen/8328563 to your computer and use it in GitHub Desktop.
Code required to create a Movie panel with Mig Layout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static JPanel createMigLayoutPanel() | |
{ | |
JPanel panel = new JPanel(); | |
JTextField title = new JTextField(); | |
JTextField descrption = new JTextField(); | |
JTextField releasedate = new JTextField(); | |
JTextField category = new JTextField(); | |
//allow 2 components per line | |
panel.setLayout(new MigLayout("wrap 2")); | |
panel.setBorder(BorderFactory.createTitledBorder("Movie")); | |
panel.add(new JLabel("Title")); | |
//grow in the x direction and span the space | |
panel.add(title, "span,growx, w 150!"); | |
panel.add(new JLabel("Description")); | |
panel.add(descrption, "growx"); | |
panel.add(new JLabel("Release Date")); | |
panel.add(releasedate, "growx"); | |
panel.add(new JLabel("Category")); | |
panel.add(category, "growx"); | |
return panel; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment