Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * AlertFrame.java
  *
  * Created on April 10, 2002, 12:11 PM
  */
 package tools.tracesviewer;
 
 import javax.swing.*;

Author(s):
Olivier Deruelle
Version:
1.2
public class AlertFrame extends JOptionPane {
    public String finalInputValue;

    
Creates new AlertFrame
    public AlertFrame(String textint messageType) {
        super("Alert");
        if (messageType == .)
            showMessageDialog(thistext"Error"messageType);
        else if (messageType == .)
            showMessageDialog(thistext"Warning"messageType);
        else
            showMessageDialog(this"Unknown alert message");
    }

    
Creates new AlertFrame
    public AlertFrame(String textint messageTypeString initialInputValue) {
        super("Alert");
         = null;
        if (messageType == .)
            showMessageDialog(thistext"Error"messageType);
        else if (messageType == .)
            showMessageDialog(thistext"Warning"messageType);
        else if (messageType == .) {
             =
                (StringshowInputDialog(this,
                    text,
                    "Information",
                    messageType,
                    null,
                    null,
                    initialInputValue);
        } else
            showMessageDialog(this"Unknown alert message");
    }

    
Creates new AlertFrame
    public AlertFrame(String text) {
        super("Alert");
        // information message by default
        showMessageDialog(thistext);
    }
New to GrepCode? Check out our FAQ X