Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/387.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java:异常\u访问\u冲突_Java_Swing - Fatal编程技术网

Java:异常\u访问\u冲突

Java:异常\u访问\u冲突,java,swing,Java,Swing,可能重复: 这是我的以下程序,我得到 我可以运行其他程序,但不能运行这个程序,你能告诉我吗 # # A fatal error has been detected by the Java Runtime Environment: # # EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000063c8d840, pid=6000, tid=3304 # # JRE version: 7.0_04-b22 # Java VM: Java

可能重复:

这是我的以下程序,我得到 我可以运行其他程序,但不能运行这个程序,你能告诉我吗

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x0000000063c8d840, pid=6000, tid=3304
#
# JRE version: 7.0_04-b22
# Java VM: Java HotSpot(TM) 64-Bit Server VM (23.0-b21 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# V  [jvm.dll+0xfd840]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# D:\hs_err_pid6000.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.sun.com/bugreport/crash.jsp
#

升级到适用于您的平台的最新版本的Java(当前为Java 7 update 11),然后重试。

您的代码在我的机器上运行良好。我有Java6


您似乎正在运行MS Windows,因为我在当时看到或遇到过这种情况。以下是您可能遇到的问题的链接

要么尝试更新JVM,要么尝试在Linux/Unix环境中运行它

import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Random;
import java.util.Vector;

import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.SwingUtilities;
import javax.swing.Timer;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.table.DefaultTableModel;
public class Preethi {
    protected void initUI() {
        final DefaultTableModel model = new DefaultTableModel(new String[] {
                "Id", "Name", "Desg" }, 0);
        final JTable table = new JTable(model);
        // table.setFillsViewportHeight(true);
        JFrame frame = new JFrame(Preethi.class.getSimpleName());
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        JScrollPane scrollpane = new JScrollPane(table);
        frame.add(scrollpane, BorderLayout.CENTER);
        frame.pack();
        frame.setVisible(true);
        Vector vec = new Vector();
        vec.add("1122");
        vec.add("Iraneee");
        vec.add("Dev");
        model.insertRow(0, vec);
        model.setValueAt("1111", 0, 0);
        //model.setValueAt(new Object[]{"1111","Pavan","Developer"}, 0, 0);

    }

    public static void main(String[] args) throws ClassNotFoundException,
            InstantiationException, IllegalAccessException,
            UnsupportedLookAndFeelException {
        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                new Preethi().initUI();
            }
        });
    }

}