1 16 package org.apache.log4j.lf5.viewer; 17 18 import javax.swing.*; 19 import java.awt.*; 20 import java.awt.event.ActionEvent ; 21 import java.awt.event.ActionListener ; 22 23 29 30 32 public class LogFactor5ErrorDialog extends LogFactor5Dialog { 33 37 41 45 public LogFactor5ErrorDialog(JFrame jframe, String message) { 49 super(jframe, "Error", true); 50 51 JButton ok = new JButton("Ok"); 52 ok.addActionListener(new ActionListener () { 53 public void actionPerformed(ActionEvent e) { 54 hide(); 55 } 56 }); 57 58 JPanel bottom = new JPanel(); 59 bottom.setLayout(new FlowLayout()); 60 bottom.add(ok); 61 62 JPanel main = new JPanel(); 63 main.setLayout(new GridBagLayout()); 64 wrapStringOnPanel(message, main); 65 66 getContentPane().add(main, BorderLayout.CENTER); 67 getContentPane().add(bottom, BorderLayout.SOUTH); 68 show(); 69 70 } 71 75 79 83 } | Popular Tags |