All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.miginfocom.examples.BugTestApp Maven / Gradle / Ivy

There is a newer version: 3.7.4
Show newest version
package net.miginfocom.examples;

import net.miginfocom.swing.MigLayout;

import javax.swing.*;

/**
 * @author Mikael Grev, MiG InfoCom AB
 *         Date: Dec 15, 2008
 *         Time: 7:04:50 PM
 */
public class BugTestApp
{
	private static JPanel createPanel()
	{
		JFrame frame = new JFrame();

		frame.setLayout(new MigLayout("debug", ""));
		frame.add(new JLabel("Top"),   "span, wrap");
		frame.add(new JLabel("Left"),  "");
		frame.add(new JLabel("Right"), "");

//		frame.setLayout(new MigLayout("debug, fillx"));
//		frame.add(new JLabel("Top"),   "span, wrap");
//		frame.add(new JLabel("Left"),  "growx");
//		frame.add(new JLabel("Right"), "");

//		frame.setLayout(new MigLayout("debug, fillx"));
//		frame.add(new JLabel("Top"),   "span, wrap");
//		frame.add(new JLabel("Left"),  "growx");
//		frame.add(new JLabel("Right"), "");

		frame.setSize(600, 400);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setVisible(true);

		return null;
	}

	private static JPanel createPanel2()
	{
		JFrame tst = new JFrame();
		tst.setLayout(new MigLayout("debug, fillx","",""));

		tst.add(new JTextField(),"span 2, grow, wrap");
		tst.add(new JTextField(10));
		tst.add(new JLabel("End"));

		tst.setSize(600, 400);
		tst.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		tst.setVisible(true);
		return null;
	}

	public static void main(String[] args)
	{
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				try {
					UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
				} catch (Exception ex) {
					ex.printStackTrace();
				}

				createPanel();
//				JFrame frame = new JFrame("Bug Test App");
//				frame.getContentPane().add(createPanel2());
//				frame.pack();
//				frame.setLocationRelativeTo(null);
//				frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
//				frame.setVisible(true);
			}
		});
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy