1 48 49 package org.exolab.jms.tools.admin; 50 51 import javax.swing.JFrame ; 52 import javax.swing.JOptionPane ; 53 54 55 64 public class QueryDialog { 65 66 private JFrame parent_; 68 69 private int status_; 71 72 static private QueryDialog instance_; 74 75 81 public QueryDialog(JFrame parent) { 82 parent_ = parent; 83 } 84 85 92 public static QueryDialog instance() { 93 return instance_; 94 } 95 96 97 104 public static QueryDialog create(JFrame parent) { 105 if (instance_ == null) { 106 instance_ = new QueryDialog(parent); 107 } 108 return instance_; 109 } 110 111 118 public void display(String st) { 119 status_ = JOptionPane.showConfirmDialog 120 (parent_, st, "Confirm Deletion", JOptionPane.YES_NO_OPTION, 121 JOptionPane.QUESTION_MESSAGE); 122 123 } 124 125 132 public boolean isConfirmed() { 133 return status_ == JOptionPane.YES_OPTION; 134 } 135 136 } 138 | Popular Tags |