0% found this document useful (0 votes)
29 views

Java Swing

The document presents a summer training presentation on the Java Swing framework, which is used to build graphical user interfaces and window-based applications on top of the Abstract Window Toolkit; it provides an overview of Java Swing classes like JButton, JFrame, JTextField and code for a simple GUI application using a JFrame container with a JButton. The code sample demonstrates how to create and add a JButton to a JFrame, set its bounds, size the frame, make it visible to display the button.

Uploaded by

Swarnim Shukla
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views

Java Swing

The document presents a summer training presentation on the Java Swing framework, which is used to build graphical user interfaces and window-based applications on top of the Abstract Window Toolkit; it provides an overview of Java Swing classes like JButton, JFrame, JTextField and code for a simple GUI application using a JFrame container with a JButton. The code sample demonstrates how to create and add a JButton to a JFrame, set its bounds, size the frame, make it visible to display the button.

Uploaded by

Swarnim Shukla
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 4

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 javax.swing
 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 javax.swing*;

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
b.setBounds(130,100,100,40); // x,y,width,height
f.add(b);
//adding button in JFrame
f.setSize(400,500); //400
width and 500 height
f.setLayout(null); //making
Frame visible
f.setVisible(true);
}
}
Output

You might also like