Añado los fuentes de java
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
package com.tarisan.chipcard.gui;
|
||||
|
||||
import javax.swing.*;
|
||||
/**
|
||||
* @author jjrider
|
||||
*
|
||||
* To change the template for this generated type comment go to
|
||||
* Window>Preferences>Java>Code Generation>Code and Comments
|
||||
*/
|
||||
public class hiloDialogo extends Thread {//implements Runnable{
|
||||
int intDialogType=0;
|
||||
String strMessage="";
|
||||
String strTitle="";
|
||||
private JFrame jframe=null;
|
||||
String options[]={"Si","No"};
|
||||
java.awt.event.ActionListener actionListener=null;
|
||||
|
||||
public hiloDialogo(JFrame f,String t,String m, int d){
|
||||
this(f, t, m, d,null);
|
||||
}
|
||||
public hiloDialogo(JFrame f,String t,String m, int d,java.awt.event.ActionListener a){
|
||||
super();
|
||||
jframe=f;
|
||||
intDialogType=d;
|
||||
strMessage=m;
|
||||
strTitle=t;
|
||||
actionListener=a;
|
||||
start();
|
||||
}
|
||||
|
||||
public void run(){
|
||||
//jframe.setVisible(true);
|
||||
if(jframe!=null)
|
||||
jframe.setFocusable(true);
|
||||
if(actionListener==null)
|
||||
JOptionPane.showMessageDialog(jframe,strMessage,strTitle,intDialogType);
|
||||
else
|
||||
confirmDialog();
|
||||
}
|
||||
|
||||
public void confirmDialog(){
|
||||
int intRetorno=JOptionPane.showOptionDialog(null, strMessage, strTitle, JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE, null,options, options[1]);
|
||||
if(actionListener!=null){
|
||||
actionListener.actionPerformed(new java.awt.event.ActionEvent(this,intRetorno,null));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user