Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
HTMLDialog.java
1 package ij.gui;
2 import java.awt.*;
3 import java.awt.event.*;
4 import javax.swing.*;
5 
7 public class HTMLDialog extends JDialog implements ActionListener {
8 
9  public HTMLDialog(String title, String message) {
10  super();
11  setTitle(title);
12  ij.util.Java2.setSystemLookAndFeel();
13  Container container = getContentPane();
14  container.setLayout(new BorderLayout());
15  if (message==null) message = "";
16  JLabel label = new JLabel(message);
17  JPanel panel = new JPanel();
18  panel.setLayout(new FlowLayout(FlowLayout.CENTER, 15, 15));
19  panel.add(label);
20  container.add(panel, "Center");
21  JButton button = new JButton("OK");
22  button.addActionListener(this);
23  panel = new JPanel();
24  panel.add(button);
25  container.add(panel, "South");
26  setForeground(Color.black);
27  pack();
28  GUI.center(this);
29  show();
30  }
31 
32  public void actionPerformed(ActionEvent e) {
33  setVisible(false);
34  dispose();
35  }
36 }