2011-07-19 20 views
1

このコードのどこにエラーの原因を突き止めるのか分かりません。うまくいけば誰かが助けてくれるはずです。エラーはソースの後に貼り付けられます。おそらく2秒前に私がeclipseを作った変更をして現在実行中のアプリケーションを終了させるまで、それは本当に完璧でした。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 
+0

自分では対応できませんが、修正できました。 '私はここにブラケットを忘れてしまった: \t \t appFrame.addWindowListener(新WindowAdapterを(){ \t \t \tます。public void windowClosing(WindowEventのイベント){ \t \t \t \t //ファイル \t \t \t} \t \tを保存}) ; ' – Firstmate

答えて

2

ブラケットがありません。

appFrame.addWindowListener(new WindowAdapter() { 
      public void windowClosing(WindowEvent event) { 
       //save file 
      **}** //Bracket here 
}); 
関連する問題