⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 confirmdialog.java

📁 时空图计算和编辑程序
💻 JAVA
字号:
package my_cpt;
import super_cpt.*;
import java.awt.*;
import java.awt.event.*;
public class ConfirmDialog extends SuperDialog implements ActionListener{
	SuperBtn okbtn=new SuperBtn("确定");
	SuperBtn nobtn=new SuperBtn("取消");
	private boolean isConfirm=false;
	public ConfirmDialog(Frame f)
	{
		super("确定对话框",f,true);
		setSize(300,70);
		setLocation(362,299);
		add(okbtn);
		add(nobtn);
		okbtn.setBounds(getWidth()/2-40,getHeight()-22,30,16);
		nobtn.setBounds(getWidth()/2+10,getHeight()-22,30,16);
		okbtn.addActionListener(this);
		nobtn.addActionListener(this);
	}
	public void actionPerformed(ActionEvent e)
	{
		isConfirm=(e.getSource()==okbtn);
		setVisible(false);
	}
	public boolean isConfirm(){return isConfirm;}
	String message="却定执行该操作?";
	public void ShowDialog(String msg)
	{
		message=msg;
		setVisible(true);
		repaint();
	}
	public void myPaint(Graphics2D g)
	{
		g.setColor(Color.GREEN);
		g.fillRect(5,25,getWidth()-8,18);
		g.setColor(Color.BLACK);
		g.drawString("警告!"+message,6,39);
	}
}

⌨️ 快捷键说明

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