-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSIMPLE_GUI
More file actions
53 lines (36 loc) · 1.24 KB
/
SIMPLE_GUI
File metadata and controls
53 lines (36 loc) · 1.24 KB
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.*;
import java.awt.event.ActionListener;
public class Login_Gui
{
public static void main(String[] args)
{
JFrame frame = new JFrame("WEATHER REPORT");
JPanel panel = new JPanel(null);
panel.setBackground(Color.CYAN);
JLabel state = new JLabel("Enter State");
JTextField stateField = new JTextField(20);
JLabel city = new JLabel("Enter City");
JTextField cityfield = new JTextField(20);
JButton button = new JButton("SUBMIT");
JLabel result = new JLabel("RESULT");
JTextField resultfield = new JTextField(20);
state.setBounds(20,20,80,25);
stateField.setBounds(100,20,160,25);
city.setBounds(20,50,80,25);
cityfield.setBounds(100,50,160,25);
result.setBounds(20,130,80,25);
resultfield.setBounds(100,130,160,25);
button.setBounds(120,100,100,25);
panel.add(state);
panel.add(stateField);
panel.add(city);
panel.add(cityfield);
panel.add(result);
panel.add(resultfield);
panel.add(button);
frame.add(panel);
frame.setSize(300,200);
frame.setVisible(true);
}
}