FileDocCategorySizeDatePackage
JFrameFlowLayout.javaAPI DocExample497Sun Jan 23 12:06:36 GMT 2000None

JFrameFlowLayout.java

import java.awt.*;
import javax.swing.*;

public class JFrameFlowLayout extends JFrame {
	public JFrameFlowLayout() {
		Container cp = getContentPane();

		// Make sure it has a FlowLayout layoutmanager.
		cp.setLayout(new FlowLayout());

		// now add Components to "cp"...
		cp.add(new JLabel("Wonderful?"));
		cp.add(new JButton("Yes!"));
		pack();
	}

	// We need a main program to instantiate and show.
	public static void main(String[] args) {
		new JFrameFlowLayout().setVisible(true);
	}
}