Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.awt.*;
- import javax.swing.*;
- public class DemoFlowLayout {
- public static void main(String args[]) {
- JFrame frame = new JFrame("Flow Layout");
- frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
- frame.setSize(300, 100);
- JPanel panel = new JPanel(new FlowLayout(FlowLayout.RIGHT));
- JButton button1 = new JButton("Button1");
- JButton button2 = new JButton("Button2");
- JButton button3 = new JButton("Button3");
- panel.add(button1);
- panel.add(button2);
- panel.add(button3);
- frame.add(panel);
- frame.setVisible(true);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement