728x90 AdSpace

Latest Article

Java Border Layout Example Code Class | Source code Java BorderLayout class example




Java Border Layout Example Code Class BorderLayout
package edu.umt.guiexamples;

import java.awt.BorderLayout;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;


public class BorderLayoutExample {
     public static void main(String[] args) {
        // TODO code application logic here
        JFrame f = new JFrame("Border Layout Example");
        JPanel p = new JPanel( );
        BorderLayout  L = new BorderLayout( );
        JButton btnNorth= new JButton("North");
        JButton btnSouth= new JButton("South");
        JButton btnEast= new JButton("East");
        JButton btnWest= new JButton("West");
        JButton btnCenter= new JButton("Center");
        p.setLayout(L);
        p.add(btnNorth,BorderLayout.NORTH);
        p.add(btnSouth,BorderLayout.SOUTH);
        p.add(btnEast,BorderLayout.EAST);
        p.add(btnWest,BorderLayout.WEST);
        p.add(btnCenter,BorderLayout.CENTER);
        f.setContentPane(p);
        f.setSize(300,300);
        f.setVisible(true);

    }
}

no image
  • Title : Java Border Layout Example Code Class | Source code Java BorderLayout class example
  • Posted by :
  • Date : 05:00
  • Labels :





  • Blogger Comments
  • Facebook Comments

0 comments:

Post a Comment

Top