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

📄 tuich.java

📁 小程序 自己写的 请多多指教 希望高手不吝赐教
💻 JAVA
字号:
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.sql.*;
 class tuich extends JFrame implements ActionListener
{   private condb con=null;
    private ResultSet rs=null;
    private String sql=null;
    private JLabel q1=new JLabel("是否确定退出本软件?");  
    private JButton d1=new JButton("确认");
    private JButton d2=new JButton("返回");
    
   public tuich()
  { super("结束");
    setSize(300,180);
    setBackground(Color.LIGHT_GRAY);
    this.setLocationRelativeTo(this.getParent());
    setResizable(false);
    Container cont=this.getContentPane();
    cont.setLayout(null);
    
    q1.setBounds(80,20,200,30);
    d1.setBounds(50,80,80,30);
    d2.setBounds(150,80,80,30);
    
    cont.add(q1);
    cont.add(d1);
    cont.add(d2);
    d1.addActionListener(this);
    d2.addActionListener(this);

    setVisible(true);

   }
 

public void actionPerformed(ActionEvent te)
 {   
    if(te.getActionCommand().equals("确认"))
     { dispose();System.exit(0);}
    if(te.getActionCommand().equals("返回"))
      dispose();  
 } 
}   

⌨️ 快捷键说明

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