CCL Home Page
Up Directory CCL ChemMessage.java
/**
 * ChemMessage.java
 * This class is used to display messages from errors to status
 *
 * Created: Fri Apr 23 10:27:49 1999
 *
 * @author Nathan Stevens
 * @version 0.2
 */
import java.awt.*;
import java.awt.event.*;
import com.sun.java.swing.*;
//import javax.swing.*;

public class ChemMessage  
{
  private JPanel parent;

  // this constructor is used when newTerm method 
  public ChemMessage()
    {
      this(new JPanel());
    }

  public ChemMessage(JPanel p)
    {
      parent = p;
    }

  // method to print error in dialog window
  public void errPrint(String m, String title)
    {
      String[] msg = {m};
      errPrint(msg,title);
    }
 
  public void errPrint(String[] msg1, String title1)
    {
      JOptionPane.showMessageDialog(parent, msg1, title1, 
                                    JOptionPane.ERROR_MESSAGE);
    }

  // Method to print simple message
  public void msgPrint(String m, String title)
    {
      String[] msg = {m};
      msgPrint(msg, title);
    }
  public void msgPrint(String[] msg2, String title2)
    {
      JOptionPane.showMessageDialog(parent, msg2, title2, 
                                    JOptionPane.PLAIN_MESSAGE);
    }  
}










Modified: Mon May 24 17:39:20 1999 GMT
Page accessed 3325 times since Sun Jun 6 15:41:36 1999 GMT