Java Swing Program to demonstrate JButton
Program
import javax.swing.*;
public class JButtonDemo
{
public static void main(String args[])
{
JFrame frm = new JFrame("JButton Demo");
JButton btnSubmit;
btnSubmit = new JButton("Login");
btnSubmit.setBounds(0, 0, 100, 50);
frm.add(btnSubmit);
frm.setSize(300, 300);
frm.setLayout(null);
frm.setVisible(true);
frm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}
Output