This commit is contained in:
2025-09-26 11:16:47 +02:00
parent a9782efcdd
commit 7c72e94d8d
18 changed files with 174 additions and 36 deletions

View File

@@ -0,0 +1,37 @@
import java.awt.BorderLayout;
import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JPanel;
public class CloseVerificationWindow extends JDialog {
public CloseVerificationWindow(ImageWindow parent) {
super(parent, true);
this.setSize(parent.getWidth() / 3, parent.getHeight() / 3);
this.setLocationRelativeTo(parent);
this.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
this.setLayout(new GridLayout(2, 1));
JLabel text = new JLabel("Are you sure you want to close the window?");
text.setVerticalAlignment(JLabel.CENTER);
text.setHorizontalAlignment(JLabel.CENTER);
this.add(text);
JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
JButton approveButton = new JButton("Yes");
approveButton.addActionListener(new ApprovedButtonPressedEvent(this));
panel.add(approveButton, BorderLayout.WEST);
JButton cancelButton = new JButton("No");
cancelButton.addActionListener(new CancelButtonPressedEvent(this));
panel.add(cancelButton, BorderLayout.EAST);
this.add(panel);
}
}