Search in sources :

Example 1 with ByteFormat

use of org.jivesoftware.spark.util.ByteFormat in project Spark by igniterealtime.

the class ReceiveFileTransfer method acceptFileTransfer.

public void acceptFileTransfer(final FileTransferRequest request) {
    String fileName = request.getFileName();
    long fileSize = request.getFileSize();
    String requestor = request.getRequestor();
    String bareJID = XmppStringUtils.parseBareJid(requestor);
    // SPARK-1869
    FileTransferNegotiator.getInstanceFor(SparkManager.getConnection());
    FileTransferNegotiator.IBB_ONLY = SettingsManager.getLocalPreferences().isFileTransferIbbOnly();
    ByteFormat format = new ByteFormat();
    String text = format.format(fileSize);
    fileLabel.setText(fileName + " (" + text + ")");
    ContactList contactList = SparkManager.getWorkspace().getContactList();
    ContactItem contactItem = contactList.getContactItemByJID(bareJID);
    titleLabel.setText(Res.getString("message.user.is.sending.you.a.file", contactItem.getDisplayName()));
    File tempFile = new File(Spark.getSparkUserHome(), "/tmp");
    try {
        tempFile.mkdirs();
        File file = new File(tempFile, fileName);
        file.delete();
        BufferedWriter out = new BufferedWriter(new FileWriter(file));
        out.write("a");
        out.close();
        imageLabel.setIcon(GraphicUtils.getIcon(file));
        // Delete temp file when program exits.
        file.delete();
    } catch (IOException e) {
        imageLabel.setIcon(SparkRes.getImageIcon(SparkRes.DOCUMENT_INFO_32x32));
        Log.error(e);
    }
    acceptButton.addMouseListener(new MouseAdapter() {

        public void mousePressed(MouseEvent e) {
            try {
                Downloads.checkDownloadDirectory();
                acceptRequest(request);
            } catch (Exception ex) {
                // this means there is a problem with the download directory
                try {
                    request.reject();
                } catch (SmackException.NotConnectedException e1) {
                    Log.warning("Unable to reject the request.", ex);
                }
                setBackground(new Color(239, 245, 250));
                acceptButton.setVisible(false);
                declineButton.setVisible(false);
                if (Downloads.getDownloadDirectory() == null) {
                    fileLabel.setText("");
                } else {
                    ResourceUtils.resLabel(fileLabel, null, Res.getString("label.transfer.download.directory") + " " + Downloads.getDownloadDirectory().getAbsolutePath());
                }
                // option to set a new path for the file-download
                pathButton.setVisible(true);
                pathButton.addMouseListener(new MouseAdapter() {

                    public void mousePressed(MouseEvent e) {
                        Preference p = SparkManager.getPreferenceManager().getPreference(new FileTransferPreference().getNamespace());
                        // retrieve the filetransfer preferences and show the preference menu
                        // to the user
                        SparkManager.getPreferenceManager().showPreferences(p);
                    }
                });
                titleLabel.setText(ex.getMessage());
                titleLabel.setForeground(new Color(65, 139, 179));
                invalidate();
                validate();
                repaint();
            }
        }
    });
    declineButton.addMouseListener(new MouseAdapter() {

        public void mousePressed(MouseEvent e) {
            rejectRequest(request);
        }
    });
}
Also used : MouseEvent(java.awt.event.MouseEvent) ContactItem(org.jivesoftware.spark.ui.ContactItem) FileWriter(java.io.FileWriter) SmackException(org.jivesoftware.smack.SmackException) Color(java.awt.Color) MouseAdapter(java.awt.event.MouseAdapter) ContactList(org.jivesoftware.spark.ui.ContactList) IOException(java.io.IOException) FileTransferPreference(org.jivesoftware.spark.filetransfer.preferences.FileTransferPreference) SmackException(org.jivesoftware.smack.SmackException) URISyntaxException(java.net.URISyntaxException) MalformedURLException(java.net.MalformedURLException) IOException(java.io.IOException) BufferedWriter(java.io.BufferedWriter) ByteFormat(org.jivesoftware.spark.util.ByteFormat) FileTransferPreference(org.jivesoftware.spark.filetransfer.preferences.FileTransferPreference) Preference(org.jivesoftware.spark.preference.Preference) File(java.io.File)

Example 2 with ByteFormat

use of org.jivesoftware.spark.util.ByteFormat in project Spark by igniterealtime.

the class CheckUpdates method downloadUpdate.

public void downloadUpdate(final File downloadedFile, final SparkVersion version) {
    final java.util.Timer timer = new java.util.Timer();
    // Prepare HTTP post
    final GetMethod post = new GetMethod(version.getDownloadURL());
    // Get HTTP client
    Protocol.registerProtocol("https", new Protocol("https", new EasySSLProtocolSocketFactory(), 443));
    final HttpClient httpclient = new HttpClient();
    String proxyHost = System.getProperty("http.proxyHost");
    String proxyPort = System.getProperty("http.proxyPort");
    if (ModelUtil.hasLength(proxyHost) && ModelUtil.hasLength(proxyPort)) {
        try {
            httpclient.getHostConfiguration().setProxy(proxyHost, Integer.parseInt(proxyPort));
        } catch (NumberFormatException e) {
            Log.error(e);
        }
    }
    try {
        int result = httpclient.executeMethod(post);
        if (result != 200) {
            return;
        }
        long length = post.getResponseContentLength();
        int contentLength = (int) length;
        bar = new JProgressBar(0, contentLength);
    } catch (IOException e) {
        Log.error(e);
    }
    final JFrame frame = new JFrame(Res.getString("title.downloading.im.client"));
    frame.setIconImage(SparkRes.getImageIcon(SparkRes.SMALL_MESSAGE_IMAGE).getImage());
    titlePanel = new TitlePanel(Res.getString("title.upgrading.client"), Res.getString("message.version", version.getVersion()), SparkRes.getImageIcon(SparkRes.SEND_FILE_24x24), true);
    final Thread thread = new Thread(() -> {
        try {
            InputStream stream = post.getResponseBodyAsStream();
            long size = post.getResponseContentLength();
            ByteFormat formater = new ByteFormat();
            sizeText = formater.format(size);
            titlePanel.setDescription(Res.getString("message.version", version.getVersion()) + " \n" + Res.getString("message.file.size", sizeText));
            downloadedFile.getParentFile().mkdirs();
            FileOutputStream out = new FileOutputStream(downloadedFile);
            copy(stream, out);
            out.close();
            if (!cancel) {
                downloadComplete = true;
                promptForInstallation(downloadedFile, Res.getString("title.download.complete"), Res.getString("message.restart.spark"));
            } else {
                out.close();
                downloadedFile.delete();
            }
            UPDATING = false;
            frame.dispose();
        } catch (Exception ex) {
        // Nothing to do
        } finally {
            timer.cancel();
            // Release current connection to the connection pool once you are done
            post.releaseConnection();
        }
    });
    frame.getContentPane().setLayout(new GridBagLayout());
    frame.getContentPane().add(titlePanel, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));
    frame.getContentPane().add(bar, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));
    JEditorPane pane = new JEditorPane();
    boolean displayContentPane = version.getChangeLogURL() != null || version.getDisplayMessage() != null;
    try {
        pane.setEditable(false);
        if (version.getChangeLogURL() != null) {
            pane.setEditorKit(new HTMLEditorKit());
            pane.setPage(version.getChangeLogURL());
        } else if (version.getDisplayMessage() != null) {
            pane.setText(version.getDisplayMessage());
        }
        if (displayContentPane) {
            frame.getContentPane().add(new JScrollPane(pane), new GridBagConstraints(0, 2, 1, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(5, 5, 5, 5), 0, 0));
        }
    } catch (IOException e) {
        Log.error(e);
    }
    frame.getContentPane().setBackground(Color.WHITE);
    frame.pack();
    if (displayContentPane) {
        frame.setSize(600, 400);
    } else {
        frame.setSize(400, 100);
    }
    frame.setLocationRelativeTo(SparkManager.getMainWindow());
    GraphicUtils.centerWindowOnScreen(frame);
    frame.addWindowListener(new WindowAdapter() {

        public void windowClosing(WindowEvent windowEvent) {
            thread.interrupt();
            cancel = true;
            UPDATING = false;
            if (!downloadComplete) {
                UIManager.put("OptionPane.okButtonText", Res.getString("ok"));
                JOptionPane.showMessageDialog(SparkManager.getMainWindow(), Res.getString("message.updating.cancelled"), Res.getString("title.cancelled"), JOptionPane.ERROR_MESSAGE);
            }
        }
    });
    frame.setVisible(true);
    thread.start();
    timer.scheduleAtFixedRate(new TimerTask() {

        int seconds = 1;

        public void run() {
            ByteFormat formatter = new ByteFormat();
            long value = bar.getValue();
            long average = value / seconds;
            String text = formatter.format(average) + "/Sec";
            String total = formatter.format(value);
            titlePanel.setDescription(Res.getString("message.version", version.getVersion()) + " \n" + Res.getString("message.file.size", sizeText) + "\n" + Res.getString("message.transfer.rate") + ": " + text + "\n" + Res.getString("message.total.downloaded") + ": " + total);
            seconds++;
        }
    }, 1000, 1000);
}
Also used : GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) JProgressBar(javax.swing.JProgressBar) WindowAdapter(java.awt.event.WindowAdapter) TimerTask(java.util.TimerTask) JFrame(javax.swing.JFrame) ByteFormat(org.jivesoftware.spark.util.ByteFormat) Protocol(org.apache.commons.httpclient.protocol.Protocol) JScrollPane(javax.swing.JScrollPane) InputStream(java.io.InputStream) HTMLEditorKit(javax.swing.text.html.HTMLEditorKit) IOException(java.io.IOException) TitlePanel(org.jivesoftware.spark.component.TitlePanel) IOException(java.io.IOException) HttpClient(org.apache.commons.httpclient.HttpClient) FileOutputStream(java.io.FileOutputStream) WindowEvent(java.awt.event.WindowEvent) GetMethod(org.apache.commons.httpclient.methods.GetMethod) JEditorPane(javax.swing.JEditorPane)

Example 3 with ByteFormat

use of org.jivesoftware.spark.util.ByteFormat in project Spark by igniterealtime.

the class ReceiveFileTransfer method acceptRequest.

private void acceptRequest(final FileTransferRequest request) {
    String requestor = request.getRequestor();
    String bareJID = XmppStringUtils.parseBareJid(requestor);
    ContactList contactList = SparkManager.getWorkspace().getContactList();
    final ContactItem contactItem = contactList.getContactItemByJID(bareJID);
    setBackground(new Color(239, 245, 250));
    acceptButton.setVisible(false);
    declineButton.setVisible(false);
    titleLabel.setText(Res.getString("message.negotiate.file.transfer"));
    titleLabel.setForeground(new Color(65, 139, 179));
    add(progressBar, new GridBagConstraints(1, 2, 2, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 0, 5), 150, 0));
    add(progressLabel, new GridBagConstraints(1, 3, 2, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 0, 5), 150, 0));
    add(cancelButton, new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 5, 5), 0, 0));
    cancelButton.setVisible(true);
    transfer = request.accept();
    final File downloadedFile = new File(Downloads.getDownloadDirectory(), request.getFileName());
    try {
        _starttime = System.currentTimeMillis();
        transfer.recieveFile(downloadedFile);
    } catch (SmackException | IOException e) {
        Log.error(e);
    }
    // setting it to percent
    progressBar.setMaximum(100);
    progressBar.setStringPainted(true);
    final Timer timer = new Timer();
    TimerTask updateProgessBar = new TimerTask() {

        @Override
        public void run() {
            if (transfer.getAmountWritten() >= request.getFileSize() || transfer.getStatus() == FileTransfer.Status.error || transfer.getStatus() == FileTransfer.Status.refused || transfer.getStatus() == FileTransfer.Status.cancelled || transfer.getStatus() == FileTransfer.Status.complete) {
                this.cancel();
                timer.cancel();
                _endtime = System.currentTimeMillis();
                updateonFinished(request, downloadedFile);
            } else {
                // 100 % = Filesize
                // x %   = Currentsize
                long p = (transfer.getAmountWritten() * 100 / transfer.getFileSize());
                progressBar.setValue(Math.round(p));
            }
        }
    };
    final Timer timer2 = new Timer();
    TimerTask updatePrograssBarText = new TimerTask() {

        long timenow;

        long timeearlier;

        long bytesnow;

        long bytesearlier;

        @Override
        public void run() {
            if (transfer.getAmountWritten() >= request.getFileSize() || transfer.getStatus() == FileTransfer.Status.error || transfer.getStatus() == FileTransfer.Status.refused || transfer.getStatus() == FileTransfer.Status.cancelled || transfer.getStatus() == FileTransfer.Status.complete) {
                this.cancel();
                timer2.cancel();
            } else {
                timenow = System.currentTimeMillis();
                bytesnow = transfer.getAmountWritten();
                bytesRead = transfer.getAmountWritten();
                if (bytesRead == -1) {
                    bytesRead = 0;
                }
                ByteFormat format = new ByteFormat();
                String text = format.format(bytesRead);
                FileTransfer.Status status = transfer.getStatus();
                if (status == FileTransfer.Status.in_progress) {
                    titleLabel.setText(Res.getString("message.receiving.file", contactItem.getDisplayName()));
                    String speed = TransferUtils.calculateSpeed(bytesnow - bytesearlier, timenow - timeearlier);
                    String est = TransferUtils.calculateEstimate(bytesnow, transfer.getFileSize(), _starttime, System.currentTimeMillis());
                    progressLabel.setText(Res.getString("message.transfer.progressbar.text.received", text, speed, est));
                } else if (status == FileTransfer.Status.negotiating_stream) {
                    titleLabel.setText(Res.getString("message.negotiate.stream"));
                }
                bytesearlier = bytesnow;
                timeearlier = timenow;
            }
        }
    };
    timer.scheduleAtFixedRate(updateProgessBar, 10, 10);
    timer2.scheduleAtFixedRate(updatePrograssBarText, 10, 500);
}
Also used : GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) ContactItem(org.jivesoftware.spark.ui.ContactItem) Color(java.awt.Color) SmackException(org.jivesoftware.smack.SmackException) FileTransfer(org.jivesoftware.smackx.filetransfer.FileTransfer) IncomingFileTransfer(org.jivesoftware.smackx.filetransfer.IncomingFileTransfer) ContactList(org.jivesoftware.spark.ui.ContactList) IOException(java.io.IOException) Timer(java.util.Timer) TimerTask(java.util.TimerTask) ByteFormat(org.jivesoftware.spark.util.ByteFormat) File(java.io.File)

Example 4 with ByteFormat

use of org.jivesoftware.spark.util.ByteFormat in project Spark by igniterealtime.

the class SendFileTransfer method updateBar.

private void updateBar(final OutgoingFileTransfer transfer, String nickname, String kBperSecond) {
    FileTransfer.Status status = transfer.getStatus();
    if (status == Status.negotiating_stream) {
        titleLabel.setText(Res.getString("message.negotiation.file.transfer", nickname));
    } else if (status == Status.error) {
        if (transfer.getException() != null) {
            Log.error("Error occured during file transfer.", transfer.getException());
        }
        progressBar.setVisible(false);
        progressLabel.setVisible(false);
        titleLabel.setText(Res.getString("message.unable.to.send.file", nickname));
        cancelButton.setVisible(false);
        retryButton.setVisible(true);
        showAlert(true);
    } else if (status == Status.in_progress) {
        titleLabel.setText(Res.getString("message.sending.file.to", nickname));
        showAlert(false);
        if (!progressBar.isVisible()) {
            progressBar.setVisible(true);
            progressLabel.setVisible(true);
        }
        try {
            SwingUtilities.invokeAndWait(() -> {
                // 100 % = Filesize
                // x %   = Currentsize
                long p = (transfer.getBytesSent() * 100 / transfer.getFileSize());
                progressBar.setValue(Math.round(p));
            });
        } catch (Exception e) {
            Log.error(e);
        }
        ByteFormat format = new ByteFormat();
        String bytesSent = format.format(transfer.getBytesSent());
        String est = TransferUtils.calculateEstimate(transfer.getBytesSent(), transfer.getFileSize(), _starttime, System.currentTimeMillis());
        progressLabel.setText(Res.getString("message.transfer.progressbar.text.sent", bytesSent, kBperSecond, est));
    } else if (status == Status.complete) {
        progressBar.setVisible(false);
        String fin = TransferUtils.convertSecondstoHHMMSS(Math.round(System.currentTimeMillis() - _starttime) / 1000);
        progressLabel.setText(Res.getString("label.time", fin));
        titleLabel.setText(Res.getString("message.you.have.sent", nickname));
        cancelButton.setVisible(false);
        showAlert(true);
    } else if (status == Status.cancelled) {
        progressBar.setVisible(false);
        progressLabel.setVisible(false);
        titleLabel.setText(Res.getString("message.file.transfer.canceled"));
        cancelButton.setVisible(false);
        retryButton.setVisible(true);
        showAlert(true);
    } else if (status == Status.refused) {
        progressBar.setVisible(false);
        progressLabel.setVisible(false);
        titleLabel.setText(Res.getString("message.file.transfer.rejected", nickname));
        cancelButton.setVisible(false);
        retryButton.setVisible(true);
        showAlert(true);
    }
}
Also used : ByteFormat(org.jivesoftware.spark.util.ByteFormat) OutgoingFileTransfer(org.jivesoftware.smackx.filetransfer.OutgoingFileTransfer) FileTransfer(org.jivesoftware.smackx.filetransfer.FileTransfer) SmackException(org.jivesoftware.smack.SmackException) MalformedURLException(java.net.MalformedURLException) IOException(java.io.IOException) Status(org.jivesoftware.smackx.filetransfer.FileTransfer.Status)

Example 5 with ByteFormat

use of org.jivesoftware.spark.util.ByteFormat in project Spark by igniterealtime.

the class SendFileTransfer method sendFile.

public void sendFile(final OutgoingFileTransfer transfer, FileTransferManager transferManager, final String jid, final String nickname) {
    this.transferManager = transferManager;
    // SPARK-1869
    FileTransferNegotiator.getInstanceFor(SparkManager.getConnection());
    FileTransferNegotiator.IBB_ONLY = SettingsManager.getLocalPreferences().isFileTransferIbbOnly();
    cancelButton.setVisible(true);
    retryButton.setVisible(false);
    this.fullJID = jid;
    this.nickname = nickname;
    this.transfer = transfer;
    String fileName = transfer.getFileName();
    long fileSize = transfer.getFileSize();
    ByteFormat format = new ByteFormat();
    String text = format.format(fileSize);
    fileToSend = new File(transfer.getFilePath());
    imageLabel.setFile(fileToSend);
    fileLabel.setText(fileName + " (" + text + ")");
    ContactList contactList = SparkManager.getWorkspace().getContactList();
    ContactItem contactItem = contactList.getContactItemByJID(jid);
    titleLabel.setText(Res.getString("message.transfer.waiting.on.user", contactItem.getDisplayName()));
    if (isImage(fileName)) {
        try {
            URL imageURL = new File(transfer.getFilePath()).toURI().toURL();
            ImageIcon image = new ImageIcon(imageURL);
            image = GraphicUtils.scaleImageIcon(image, 64, 64);
            imageLabel.setIcon(image);
        } catch (MalformedURLException e) {
            Log.error("Could not locate image.", e);
            imageLabel.setIcon(SparkRes.getImageIcon(SparkRes.DOCUMENT_INFO_32x32));
        }
    } else {
        File file = new File(transfer.getFilePath());
        Icon icon = GraphicUtils.getIcon(file);
        imageLabel.setIcon(icon);
    }
    cancelButton.addMouseListener(new MouseAdapter() {

        public void mouseClicked(MouseEvent mouseEvent) {
            transfer.cancel();
        }
    });
    cancelButton.addMouseListener(new MouseAdapter() {

        public void mouseEntered(MouseEvent e) {
            cancelButton.setCursor(new Cursor(Cursor.HAND_CURSOR));
        }

        public void mouseExited(MouseEvent e) {
            cancelButton.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
        }
    });
    progressBar.setMaximum(100);
    progressBar.setVisible(false);
    progressBar.setStringPainted(true);
    add(progressBar, new GridBagConstraints(1, 2, 2, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 0, 5), 150, 0));
    add(progressLabel, new GridBagConstraints(1, 3, 2, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 0, 5), 150, 0));
    SwingWorker worker = new SwingWorker() {

        public Object construct() {
            while (true) {
                try {
                    if (transfer.getBytesSent() > 0 && _starttime == 0) {
                        _starttime = System.currentTimeMillis();
                    }
                    long starttime = System.currentTimeMillis();
                    long startbyte = transfer.getBytesSent();
                    Thread.sleep(500);
                    FileTransfer.Status status = transfer.getStatus();
                    if (status == Status.error || status == Status.complete || status == Status.cancelled || status == Status.refused) {
                        break;
                    }
                    long endtime = System.currentTimeMillis();
                    long endbyte = transfer.getBytesSent();
                    long timediff = endtime - starttime;
                    long bytediff = endbyte - startbyte;
                    updateBar(transfer, nickname, TransferUtils.calculateSpeed(bytediff, timediff));
                } catch (InterruptedException e) {
                    Log.error("Unable to sleep thread.", e);
                }
            }
            return "";
        }

        public void finished() {
            updateBar(transfer, nickname, "??MB/s");
        }
    };
    worker.start();
    makeClickable(imageLabel);
    makeClickable(titleLabel);
}
Also used : ImageIcon(javax.swing.ImageIcon) MalformedURLException(java.net.MalformedURLException) GridBagConstraints(java.awt.GridBagConstraints) MouseEvent(java.awt.event.MouseEvent) Insets(java.awt.Insets) ContactItem(org.jivesoftware.spark.ui.ContactItem) MouseAdapter(java.awt.event.MouseAdapter) OutgoingFileTransfer(org.jivesoftware.smackx.filetransfer.OutgoingFileTransfer) FileTransfer(org.jivesoftware.smackx.filetransfer.FileTransfer) ContactList(org.jivesoftware.spark.ui.ContactList) Cursor(java.awt.Cursor) URL(java.net.URL) Status(org.jivesoftware.smackx.filetransfer.FileTransfer.Status) ByteFormat(org.jivesoftware.spark.util.ByteFormat) SwingWorker(org.jivesoftware.spark.util.SwingWorker) ImageIcon(javax.swing.ImageIcon) Icon(javax.swing.Icon) File(java.io.File)

Aggregations

ByteFormat (org.jivesoftware.spark.util.ByteFormat)5 IOException (java.io.IOException)4 GridBagConstraints (java.awt.GridBagConstraints)3 Insets (java.awt.Insets)3 File (java.io.File)3 MalformedURLException (java.net.MalformedURLException)3 SmackException (org.jivesoftware.smack.SmackException)3 FileTransfer (org.jivesoftware.smackx.filetransfer.FileTransfer)3 ContactItem (org.jivesoftware.spark.ui.ContactItem)3 ContactList (org.jivesoftware.spark.ui.ContactList)3 Color (java.awt.Color)2 MouseAdapter (java.awt.event.MouseAdapter)2 MouseEvent (java.awt.event.MouseEvent)2 TimerTask (java.util.TimerTask)2 Status (org.jivesoftware.smackx.filetransfer.FileTransfer.Status)2 OutgoingFileTransfer (org.jivesoftware.smackx.filetransfer.OutgoingFileTransfer)2 Cursor (java.awt.Cursor)1 GridBagLayout (java.awt.GridBagLayout)1 WindowAdapter (java.awt.event.WindowAdapter)1 WindowEvent (java.awt.event.WindowEvent)1