showecm.java~6~

来自「我自己用java写的记事本」· JAVA~6~ 代码 · 共 45 行

JAVA~6~
45
字号
package texteditor;

/**
 * <p>Title: 文本编辑器</p>
 * <p>Description: 本软件为面向对象程序设计期末作业,不得擅自修改</p>
 * <p>Copyright: Copyright (c) 2004</p>
 * <p>Company: 边缘开发室</p>
 * @author 第三组 ,组长:谭XX
 * @version 1.0
 */

import javax.swing.*;

public class ShowECM
{
  public ShowECM()
  {
    //构造函数,不需要任何初始化
  }

  //显示出错信息
  public static void showError(String content, String title)
  {
    ImageIcon errPic = new ImageIcon("src/image/error.gif");
    JOptionPane.showMessageDialog(null, content, title,
                                  JOptionPane.ERROR_MESSAGE, errPic);
  }

  public static int showConfirm(String content, String title)
  {
    ImageIcon errPic = new ImageIcon("src/image/comfirm.gif");
    return JOptionPane.showConfirmDialog(null, content, title,
                                         JOptionPane.YES_NO_OPTION,
                                         JOptionPane.QUESTION_MESSAGE, errPic);

  }

  public static void showMessage(String content, String title)
  {
    ImageIcon messagePic = new ImageIcon("src/image/java.png");
    JOptionPane.showMessageDialog(null, content, title, JOptionPane.OK_OPTION,
                                  messagePic);
  }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?