Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package sample;
- import javax.swing.JFrame;
- import javax.swing.JButton;
- import java.awt.BorderLayout;
- public class Bttns {
- Bttns(){
- JFrame frame = new JFrame("These are the buttons samples");
- JButton button,button1, button2, button3,button4;
- button = new JButton("West");
- button1 = new JButton("East");
- button2 = new JButton("North");
- button3 = new JButton("South");
- button4 = new JButton("center");
- frame.add(button,BorderLayout.WEST);
- frame.add(button1, BorderLayout.EAST);
- frame.add(button2, BorderLayout.NORTH);
- frame.add(button3, BorderLayout.SOUTH);
- frame.add(button4, BorderLayout.CENTER);
- frame.setSize(300,300);
- frame.setVisible(true);
- }
- public static void main(String[] args){
- new Bttns();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement