Skip to content

Commit 0ad643e

Browse files
Added Java Swing Program
Simple Swing program.
1 parent d4f6b3d commit 0ad643e

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

swing.class

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#https://www.facebook.com/allan.fernandes.716970/posts/2873704399437662
2+
#Subscribed by Allan for Code House
3+
import javax.swing.*;
4+
public class JTextFieldPgm
5+
{
6+
public static void main(String args[])
7+
{
8+
JFrame f=new JFrame("My first App");
9+
JLabel namelabel= new JLabel("User ID: ");
10+
namelabel.setBounds(10, 20, 70, 10);
11+
JLabel passwordLabel = new JLabel("Password: ");
12+
passwordLabel.setBounds(10, 50, 70, 10);
13+
JTextField jt = new JTextField();
14+
jt.setBounds(80, 20, 100, 20);
15+
JPasswordField jp = new JPasswordField();
16+
jp.setBounds(80, 50, 100, 20);
17+
f.add(namelabel);
18+
f.add( passwordLabel);
19+
f.add(jt);
20+
f.add(jp);
21+
f.setSize(300, 300);
22+
f.setLayout(null);
23+
f.setVisible(true);
24+
}
25+
}

0 commit comments

Comments
 (0)