r(JOptionPane.NO);
194 });
195 }
196 if((buttons & CANCEL) == CANCEL){
197 pane.addButton(pane.getCancelButton());
198 pane.addCloseListener(pane.getCancelButton());
199 pane.getCancelButton().addActionListener(function(){
200 handler(JOptionPane.CANCEL);
201 });
202 }
203 if((buttons & CLOSE) == CLOSE){
204 pane.addButton(pane.getCloseButton());
205 pane.addCloseListener(pane.getCloseButton());
206 pane.getCloseButton().addActionListener(function(){
207 handler(JOptionPane.CLOSE);
208 });
209 }
210
211 frame.addEventListener(JFrame.ON_WINDOW_CLOSING,
212 function(){
213 handler(JOptionPane.CLOSE);
214 });
215
216 frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
217 frame.setResizable(false);
218 frame.getContentPane().append(pane, BorderLayout.CENTER);
219 frame.pack();
220 frame.setLocation((Stage.width-frame.getWidth())/2, (Stage.height-frame.getHeight())/2);
221 frame.show();
222 return pane;
223 }
224
225