GOVERNMENT ENGINEERING COLLEGE
BILASPUR
PRESENTATION ON SUMMER TRAINING AT CRISP BHOPAL
SUBJECT- J2SE
GUIDED BY
ASST. PROF PRASHANT
VAISHNAV SIR
Java Swing
It is a part of Foundation classes and comes under the
package [Link]
Used mainly for building Windows Based Application and
Graphical User Interfaces.
It is built on the top of AWT (Abstract Window Toolkit) API
written in Java.
AWT is a container containing textfields , buttons etc.
A javax Swing package provides the java swing classes like :-
JButton , Jframe , Jtextfield , JRadioButton , JCheckBox
etc.
Program for Simple GUI Application using Swing.
package GUI;
import [Link]*;
public class SwingExample {
public static void main(String []args)
{
JFrame j=new JFrame();
//creating instance of JFrame
JButton b=new JButton(“ Click Me ”); //creating instance of JButton
[Link](130,100,100,40); // x,y,width,height
[Link](b);
//adding button in JFrame
[Link](400,500); //400
width and 500 height
[Link](null); //making
Frame visible
[Link](true);
}
}
Output