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;
}


Variable Index

 o ANNULER
 o NON
 o OK
 o OUI
ex: Utiliser OUI | NON pour afficher les buttons oui et non

Constructor Index

 o MsgDlg(Frame, String)
constructeur avec parametres.
 o MsgDlg(Frame, String, String, String, String, String)

Method Index

 o getResultat()
retourne resultat.
 o JWEventPerformed(JWEvent)
 o show(String, int)
 o show(String[], int)
redefinie la methode show(String message, int button)
 o windowActivated(WindowEvent)
 o windowClosed(WindowEvent)
 o windowClosing(WindowEvent)
l evenement window.close retourne toujours le button annuler! alors il faut toujour demander aussi pour set valeur
 o windowDeactivated(WindowEvent)
 o windowDeiconified(WindowEvent)
 o windowIconified(WindowEvent)
 o windowOpened(WindowEvent)

Variables

 o OUI
 public static final int OUI
ex: Utiliser OUI | NON pour afficher les buttons oui et non

 o NON
 public static final int NON
 o OK
 public static final int OK
 o ANNULER
 public static final int ANNULER

Constructors

 o MsgDlg
 public MsgDlg(Frame parent,
               String titel)
constructeur avec parametres.

Parameters:
Frame - parent
String - titel
 o MsgDlg
 public MsgDlg(Frame parent,
               String titel,
               String S_YES,
               String S_NO,
               String S_OK,
               String S_CANCEL)

Methods

 o show
 public int show(String message,
                 int button)
Parameters:
message - le message
Returns:
show(m,button)
 o 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
 o getResultat
 public int getResultat()
retourne resultat.

 o JWEventPerformed
 public void JWEventPerformed(JWEvent j)
 o windowClosed
 public void windowClosed(WindowEvent event)
 o windowDeiconified
 public void windowDeiconified(WindowEvent event)
 o windowIconified
 public void windowIconified(WindowEvent event)
 o windowActivated
 public void windowActivated(WindowEvent event)
 o windowDeactivated
 public void windowDeactivated(WindowEvent event)
 o windowOpened
 public void windowOpened(WindowEvent event)
 o windowClosing
 public void windowClosing(WindowEvent event)
l evenement window.close retourne toujours le button annuler! alors il faut toujour demander aussi pour set valeur