关闭窗体问题?
import java.awt.Toolkit;
import java.awt.TrayIcon;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.WindowConstants;
import java.sql.*;
import java.io.*;
import net.sourceforge.jtds.jdbc.Driver;
import java.util.Timer;
import java.util.TimerTask;
import java.util.*;
import java.awt.*;
import javax.swing.*;
public class TrayIconAdvanced extends JFrame {
private TrayIcon ti;
public static void main(String[] args) {
AnnoyingBeep aaa=new AnnoyingBeep();
aaa.AnnoyingBeep();
}
public TrayIconAdvanced() {
setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE);
this.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
if (SystemTray.isSupported()) {
setVisible(false);
minimizeToTray();
} else {
System.exit(0);
}
}
});
JPanel root = new JPanel();
//JLabel label=new JLabel( "您有新消息,请查收! ");
JButton exitButton = new JButton( "您有新消息,请查收! ");
exitButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {