Bug 339 - Exception is thrown when submitting the user name
Summary: Exception is thrown when submitting the user name
Status: RESOLVED FIXED
Alias: None
Product: Limited Linking Kindergarten
Classification: Unclassified
Component: Main Game (show other bugs)
Version: V1.0
Hardware: PC Windows
: High major
Assignee: qihuadong2-c
URL:
: 344 (view as bug list)
Depends on:
Blocks: 344
  Show dependency tree
 
Reported: 2019-12-04 22:25 HKT by qihuadong2-c
Modified: 2019-12-05 13:12 HKT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description qihuadong2-c 2019-12-04 22:25:44 HKT

    
Comment 1 qihuadong2-c 2019-12-05 11:27:51 HKT
Steps to reproduce:
1, Run main game
2, Enter the name and submit

Acutal result:
The console outputs:
Error
java.lang.ArrayIndexOutOfBoundsException: 1
	at GUI.Score.ScoreBoard.showScoreBoard(ScoreBoard.java:25)
	at GUI.MainPage.<init>(MainPage.java:51)
	at GUI.PreGamePage.actionPerformed(PreGamePage.java:123)
	at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
	at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
	at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
	at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
	at java.awt.Component.processMouseEvent(Unknown Source)
	at javax.swing.JComponent.processMouseEvent(Unknown Source)
	at java.awt.Component.processEvent(Unknown Source)
	at java.awt.Container.processEvent(Unknown Source)
	at java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Window.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.awt.EventQueue.access$500(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue$4.run(Unknown Source)
	at java.awt.EventQueue$4.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)

Expected output:
No exception displayed
Comment 2 dehezhang2-c 2019-12-05 12:11:23 HKT
The problem is solved by resetting the ArrayList in the scoreboard. Please try the updated version!!
Comment 3 dehezhang2-c 2019-12-05 12:31:14 HKT
*** Bug 344 has been marked as a duplicate of this bug. ***
Comment 4 dehezhang2-c 2019-12-05 13:12:52 HKT
The problem is solved by deleting the static function in the ScoreBoard class. Please try the updated version!!