-
Notifications
You must be signed in to change notification settings - Fork 0
/
first.java
53 lines (42 loc) · 1.03 KB
/
first.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
class first extends JFrame
{
JLabel l;
JTextArea name;
JButton submit;
public first()
{
setSize(900,400);
setLayout(new GridBagLayout());
getContentPane().setBackground(Color.GREEN);
GridBagConstraints gbc=new GridBagConstraints();
gbc.gridx=1;
gbc.gridy=1;
gbc.gridwidth=1;
gbc.gridheight=1;
gbc.weightx=1.0;
gbc.weighty=1.0;
gbc.ipadx=100;
gbc.ipady=10;
Font f=new Font("Enter Your name",Font.BOLD,24);
JLabel ll=new JLabel("***************WELCOME TO Rishabh'S CHAT APPLICATION**************");
ll.setFont(f);
ll.setBackground(Color.BLUE);
add(ll,gbc);
gbc.gridx=1;
gbc.gridy=2;
l=new JLabel(" **************ENTER YOUR NAME***************");
l.setBackground(Color.BLACK);
l.setFont(f);
add(l,gbc);
gbc.gridy=3;
name=new JTextArea();
add(name,gbc);
gbc.gridy=4;
submit=new JButton("Submit");
add(submit,gbc);
setVisible(true);
}
}