gpt4 book ai didi

java - Eclipse 中出现很多错误

转载 作者:行者123 更新时间:2023-11-30 05:00:58 25 4
gpt4 key购买 nike

我不知道在哪里可以查明此代码中的错误根源,希望有人可以提供帮助。错误粘贴在源代码之后。它真的很好,直到大约 2 秒前,当我做了一个更改,使得 Eclipse 想要终止当前正在运行的应用程序。

import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.Vector;

import javax.swing.JFrame;
import javax.swing.JMenuBar;
import javax.swing.JPanel;
import javax.swing.JSplitPane;
import javax.swing.JTree;


public class AnimationManager {


private JFrame appFrame;
private JPanel mainPanel;
private JMenuBar menuBar;
private JPanel filePanel;
private JPanel indexPanel;
private JPanel propsPanel;
private JPanel dataPanel;

private JTree index;

public AnimationManager() {
appFrame = new JFrame("Animation Manager v0.1 by Firstmate");
appFrame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent event) {
//save file

});
appFrame.setContentPane(createContentPane());
createMenuBar();
appFrame.setSize(1024, 768);
appFrame.setVisible(true);
}
private void createMenuBar() {
menuBar = new JMenuBar();
}
private JPanel createContentPane() {
mainPanel = new JPanel(new BorderLayout());
mainPanel.setBorder(null);
createFilePanel();
createDataPanel();
JSplitPane mainSplit = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, true, filePanel, dataPanel);
mainPanel.add(mainSplit, BorderLayout.CENTER);
return mainPanel;
}
private void createFilePanel() {
filePanel = new JPanel(new BorderLayout());
filePanel.setPreferredSize(new Dimension(150, 700));
indexPanel = new JPanel();
indexPanel.setPreferredSize(new Dimension(150,350));
Vector vector = new Vector();
vector.add("One");
vector.add("Two");
index = new JTree(vector);
index.setSize(300, 350);
indexPanel.add(index);

propsPanel = new JPanel();
propsPanel.setPreferredSize(new Dimension(150, 350));
JSplitPane fileSplit = new JSplitPane(JSplitPane.VERTICAL_SPLIT, true, indexPanel, propsPanel);
filePanel.add(fileSplit, BorderLayout.CENTER);
}
private void createDataPanel() {
dataPanel = new JPanel();
dataPanel.setSize(724, 700);
}
public JFrame getAppFrame() {
return appFrame;
}
public static void main(String[] args) {
try {
//UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
} catch (Exception e) {
e.printStackTrace();
}
AnimationManager am = new AnimationManager();
}

}

Description Resource Path Location Type
Syntax error on token "(", ; expected AnimationManager.java /AnimationManager/src line 75 Java Problem
Syntax error on token "(", ; expected AnimationManager.java /AnimationManager/src line 75 Java Problem
Syntax error on token ")", ; expected AnimationManager.java /AnimationManager/src line 75 Java Problem
Syntax error on token ")", ; expected AnimationManager.java /AnimationManager/src line 75 Java Problem
Syntax error on token "{", invalid Type AnimationManager.java /AnimationManager/src line 42 Java Problem
Syntax error on token "{", invalid Type AnimationManager.java /AnimationManager/src line 42 Java Problem
Syntax error on token "{", invalid Type AnimationManager.java /AnimationManager/src line 51 Java Problem
Syntax error on token "{", invalid Type AnimationManager.java /AnimationManager/src line 51 Java Problem
Syntax error on token "}", delete this token AnimationManager.java /AnimationManager/src line 38 Java Problem
Syntax error on token "}", delete this token AnimationManager.java /AnimationManager/src line 38 Java Problem
Syntax error on token "}", delete this token AnimationManager.java /AnimationManager/src line 50 Java Problem
Syntax error on token "}", delete this token AnimationManager.java /AnimationManager/src line 50 Java Problem
Syntax error on token "}", delete this token AnimationManager.java /AnimationManager/src line 67 Java Problem
Syntax error on token "}", delete this token AnimationManager.java /AnimationManager/src line 67 Java Problem
Syntax error on token "}", delete this token AnimationManager.java /AnimationManager/src line 84 Java Problem
Syntax error on token "JFrame", @ expected AnimationManager.java /AnimationManager/src line 72 Java Problem
Syntax error on token "JFrame", @ expected AnimationManager.java /AnimationManager/src line 72 Java Problem
Syntax error on token "JPanel", @ expected AnimationManager.java /AnimationManager/src line 42 Java Problem
Syntax error on token "JPanel", @ expected AnimationManager.java /AnimationManager/src line 42 Java Problem
Syntax error on token "void", @ expected AnimationManager.java /AnimationManager/src line 39 Java Problem
Syntax error on token "void", @ expected AnimationManager.java /AnimationManager/src line 39 Java Problem
Syntax error on token "void", @ expected AnimationManager.java /AnimationManager/src line 51 Java Problem
Syntax error on token "void", @ expected AnimationManager.java /AnimationManager/src line 51 Java Problem
Syntax error on token "void", @ expected AnimationManager.java /AnimationManager/src line 68 Java Problem
Syntax error on token "void", @ expected AnimationManager.java /AnimationManager/src line 68 Java Problem
Syntax error on token(s), misplaced construct(s) AnimationManager.java /AnimationManager/src line 39 Java Problem
Syntax error on token(s), misplaced construct(s) AnimationManager.java /AnimationManager/src line 39 Java Problem
Syntax error on token(s), misplaced construct(s) AnimationManager.java /AnimationManager/src line 68 Java Problem
Syntax error on token(s), misplaced construct(s) AnimationManager.java /AnimationManager/src line 68 Java Problem
Syntax error, insert "}" to complete ClassBody AnimationManager.java /AnimationManager/src line 25 Java Problem
Syntax error, insert "}" to complete ClassBody AnimationManager.java /AnimationManager/src line 33 Java Problem
Syntax error, insert "}" to complete ClassBody AnimationManager.java /AnimationManager/src line 33 Java Problem
Syntax error, insert "enum Identifier" to complete EnumHeaderName AnimationManager.java /AnimationManager/src line 72 Java Problem
Syntax error, insert "enum Identifier" to complete EnumHeaderName AnimationManager.java /AnimationManager/src line 72 Java Problem
Syntax error, insert "EnumBody" to complete BlockStatement AnimationManager.java /AnimationManager/src line 72 Java Problem
Syntax error, insert "EnumBody" to complete BlockStatement AnimationManager.java /AnimationManager/src line 72 Java Problem

最佳答案

你缺少一个括号。

appFrame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent event) {
//save file
**}** //Bracket here
});

关于java - Eclipse 中出现很多错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6741742/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com