-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSuccessProductAdding.java
More file actions
36 lines (28 loc) · 962 Bytes
/
SuccessProductAdding.java
File metadata and controls
36 lines (28 loc) · 962 Bytes
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
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
public class SuccessProductAdding extends JFrame {
JButton okButton;
SuccessProductAdding() {
super();
super.setBounds(400, 300, 250, 100);
super.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
super.setLayout(new FlowLayout());
super.setVisible(true);
JLabel errorLabel = new JLabel("Продукт успішно доданий! ");
okButton = new JButton("OK");
okButton.addActionListener(new WrongListener());
Container container = super.getContentPane();
container.add(errorLabel);
container.add(okButton);
}
class WrongListener implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) {
if (e.getSource() == okButton) {
dispose();
}
}
}
}