Home | Add to Favorites | Ebooks Directory | News  
Java Programming
Home
Java  Article
Java Tutorial 
Java download
Books
JDBC
Java Training
Java Source  Code
Java Applet
Java Questions
Java JFrame , Border Layout Sample Program

This Prgram Explanins about how to  create JFrame and using  BorderLayout


 


This is a simple Java program explains about JFrame and Border Layout

Visit Java Article part to find more java programs



*
* JFramExample.java
*
* Created on May 1, 2005, 12:39 PM
*/

/**
*
* @author Administrator
*/
public class JFramExample extends javax.swing.JFrame {

/** Creates new form JFramExample */
public JFramExample() {
initComponents();
}

/** This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*/
private void initComponents() {
jTextArea1 = new javax.swing.JTextArea();
jPanel1 = new javax.swing.JPanel();
jButton1 = new javax.swing.JButton();

addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent evt) {
exitForm(evt);
}
});

getContentPane().add(jTextArea1, java.awt.BorderLayout.CENTER);

jButton1.setText("jButton1");
jPanel1.add(jButton1);

getContentPane().add(jPanel1, java.awt.BorderLayout.SOUTH);

pack();
}

/** Exit the Application */
private void exitForm(java.awt.event.WindowEvent evt) {
System.exit(0);
}

/**
* @param args the command line arguments
*/
public static void main(String args[]) {
new JFramExample().show();
}

// Variables declaration - do not modify
private javax.swing.JButton jButton1;
private javax.swing.JPanel jPanel1;
private javax.swing.JTextArea jTextArea1;
// End of variables declaration

}