-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFamilyPic.java
More file actions
104 lines (100 loc) · 2.62 KB
/
FamilyPic.java
File metadata and controls
104 lines (100 loc) · 2.62 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class FamilyPic extends JFrame implements ActionListener{
JButton dawar, daamin, jozy, basharat, photo, clear, da, dajr, jn, ba;
JPanel panel;
ImageIcon photos, damin, daawar, bashart, joozy;
static int w, x, y, z;
FamilyPic(){
super("Family Pic");
setExtendedState(JFrame.MAXIMIZED_BOTH);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
panel=new JPanel();
photos=new ImageIcon("information.jpg");
damin=new ImageIcon("daamin.jpg");
daawar=new ImageIcon("dawar.jpg");
joozy=new ImageIcon("jozy.jpg");
bashart=new ImageIcon("bash.jpg");
photo=new JButton(photos);
da=new JButton(damin);
dajr=new JButton(daawar);
jn=new JButton(joozy);
ba=new JButton(bashart);
basharat=new JButton("Basharat");
basharat.setBackground(Color.GREEN);
basharat.addActionListener(this);
daamin=new JButton("Daamin");
daamin.setBackground(Color.BLUE);
daamin.addActionListener(this);
dawar=new JButton("Dawar");
dawar.setBackground(Color.RED);
dawar.addActionListener(this);
jozy=new JButton("Jozy");
jozy.setBackground(Color.PINK);
jozy.addActionListener(this);
clear=new JButton("Clear");
clear.addActionListener(this);
BorderLayout bord=new BorderLayout();
setLayout(bord);
panel.add(ba);
panel.add(jn);
panel.add(dajr);
panel.add(da);
panel.add(photo);
panel.add(daamin);
panel.add(dawar);
panel.add(jozy);
panel.add(basharat);
panel.add(clear);
da.setVisible(false);
dajr.setVisible(false);
jn.setVisible(false);
ba.setVisible(false);
add(panel);
pack();
setVisible(true);
}
public void actionPerformed(ActionEvent evt){
Object source=evt.getSource();
if (source == daamin){
da.setVisible(true);
photo.setVisible(false);
dajr.setVisible(false);
jn.setVisible(false);
ba.setVisible(false);
}
if (source == basharat){
da.setVisible(false);
photo.setVisible(false);
dajr.setVisible(false);
jn.setVisible(false);
ba.setVisible(true);
}
if (source == dawar){
da.setVisible(false);
photo.setVisible(false);
dajr.setVisible(true);
jn.setVisible(false);
ba.setVisible(false);
}
if (source == clear){
da.setVisible(false);
photo.setVisible(true);
dajr.setVisible(false);
jn.setVisible(false);
ba.setVisible(false);
}
if (source == jozy){
da.setVisible(false);
photo.setVisible(false);
dajr.setVisible(false);
jn.setVisible(true);
ba.setVisible(false);
}
repaint();
}
public static void main(String[] args){
FamilyPic fp=new FamilyPic();
}
}