相关疑难解决方法(0)

java中的System.exit(0)

我正在使用swing编写应用程序.我需要通过单击JButton可以使用的for System.exit()或者我应该使用其他方法退出应用程序,这是最佳实践.如果调用System.exit()不是最佳实践,那么告诉原因并告诉退出应用程序的替代方法.

java swing

10
推荐指数
2
解决办法
5825
查看次数

取消文件打开对话框后的InterruptedException - 1.6.0_26

以下代码的输出是:

java.vendor     Sun Microsystems Inc.
java.version    1.6.0_26
java.runtime.version    1.6.0_26-b03
sun.arch.data.model     32
os.name     Windows XP
os.version  5.1
os.arch     x86
Input selection cancelled by user.
Exception while removing reference: java.lang.InterruptedException
java.lang.InterruptedException
    at java.lang.Object.wait(Native Method)
    at java.lang.ref.ReferenceQueue.remove(Unknown Source)
    at java.lang.ref.ReferenceQueue.remove(Unknown Source)
    at sun.java2d.Disposer.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Run Code Online (Sandbox Code Playgroud)

以下代码显示了我的计算机上的异常.

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class GUI extends JPanel implements ActionListener {

    private final String newline = System.getProperty("line.separator");
    JButton openButton;
    JTextArea log;
    JFileChooser fc;

    public GUI() {
        super(new BorderLayout());

        log = new JTextArea(20,40); …
Run Code Online (Sandbox Code Playgroud)

java swing jfilechooser interrupted-exception

10
推荐指数
1
解决办法
5090
查看次数

标签 统计

java ×2

swing ×2

interrupted-exception ×1

jfilechooser ×1