Class MsgDlg
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Window
|
+----java.awt.Dialog
|
+----MsgDlg
- public class MsgDlg
- extends Dialog
- implements JWListener, WindowListener
Classe qui sert a afficher un Dialog
on l'appele avec parametres de Texte pour demander/afficher,
le titre
et le Boutons qui sont affiches
et recevoi un resultat: le button qui a ete appuie
Example de l'utilisation pour creer une question avec oui ou non.
MsgDlg m = new MsgDlg(this,"Titel text");
switch (m.show("Une Message ou question ...",MsgDlg.OUI | MsgDlg.NON)
{
case MsgDlg.OUI: System.out.println("OUI"); break;
case MsgDlg.NON: System.out.println("NON"); break;
// case MsgDlg.ANNULER: System.out.println("Operation annulle"); break; // Button Annuler n'est pas inclu
// case MsgDlg.OK: System.out.println("OUI"); break; // Button OK n'est pas inclu
default: System.out.println("pas possible"); break;
}
-
ANNULER
-
-
NON
-
-
OK
-
-
OUI
- ex: Utiliser OUI | NON
pour afficher les buttons oui et non
-
MsgDlg(Frame, String)
- constructeur avec parametres.
-
MsgDlg(Frame, String, String, String, String, String)
-
-
getResultat()
- retourne resultat.
-
JWEventPerformed(JWEvent)
-
-
show(String, int)
-
-
show(String[], int)
- redefinie la methode show(String message, int button)
-
windowActivated(WindowEvent)
-
-
windowClosed(WindowEvent)
-
-
windowClosing(WindowEvent)
- l evenement window.close retourne toujours le button annuler!
alors il faut toujour demander aussi pour set valeur
-
windowDeactivated(WindowEvent)
-
-
windowDeiconified(WindowEvent)
-
-
windowIconified(WindowEvent)
-
-
windowOpened(WindowEvent)
-
OUI
public static final int OUI
- ex: Utiliser OUI | NON
pour afficher les buttons oui et non
NON
public static final int NON
OK
public static final int OK
ANNULER
public static final int ANNULER
MsgDlg
public MsgDlg(Frame parent,
String titel)
- constructeur avec parametres.
- Parameters:
- Frame - parent
- String - titel
MsgDlg
public MsgDlg(Frame parent,
String titel,
String S_YES,
String S_NO,
String S_OK,
String S_CANCEL)
show
public int show(String message,
int button)
- Parameters:
- message - le message
- Returns:
- show(m,button)
show
public int show(String message[],
int button)
- redefinie la methode show(String message, int button)
- Parameters:
- String - message[] tableaux de chaines, labels des boutons crees
- Returns:
- int resultat
getResultat
public int getResultat()
- retourne resultat.
JWEventPerformed
public void JWEventPerformed(JWEvent j)
windowClosed
public void windowClosed(WindowEvent event)
windowDeiconified
public void windowDeiconified(WindowEvent event)
windowIconified
public void windowIconified(WindowEvent event)
windowActivated
public void windowActivated(WindowEvent event)
windowDeactivated
public void windowDeactivated(WindowEvent event)
windowOpened
public void windowOpened(WindowEvent event)
windowClosing
public void windowClosing(WindowEvent event)
- l evenement window.close retourne toujours le button annuler!
alors il faut toujour demander aussi pour set valeur