Sunday, January 13, 2013

JPanel Example In Java.♥

import javax.swing.*; 
import java.awt.* ;
class fine2
{
public static void main(String args [])
{
JFrame frame = new JFrame("Title Bar Text");  
JPanel panel = new JPanel();
panel.setLayout(new FlowLayout());
JButton button1 = new JButton("Button Text");
panel.add(button1);
frame.add(panel);    
frame.setSize(456,456);                           
frame.setDefaultCloseOperation(frame.EXIT_ON_CLOSE);
frame.setVisible(true);
 }
}

OUTPUT :

No comments: