我修復了我以前的問題。但現在當我的瓷磚地圖...如果我嘗試去9瓦的權利,並試圖讓到第9瓦....我會得到這個錯誤:Java Applet - ArrayIndexOutOfBoundsException(pt 2)
Exception in thread "AWT-EventQueue-1" java.lang.ArrayIndexOutOfBoundsException: 8
at tileGen.blocked(tileGen.java:125)
at tileGen.keyPressed(tileGen.java:58)
at java.awt.Component.processKeyEvent(Component.java:6221)
at java.awt.Component.processEvent(Component.java:6040)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4630)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1850)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(DefaultKeyboardFocusManager.java:712)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(DefaultKeyboardFocusManager.java:990)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:855)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:676)
at java.awt.Component.dispatchEventImpl(Component.java:4502)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
這裏是代碼:http://www.so.pastebin.com/hYkpQf13
我已經嘗試了許多解決方案,所有這些都失敗了。
我看到很多System.out.println(),你能顯示那個輸出的(最後一行)嗎? – 2010-05-31 20:35:15