Java: Index out of bounds

久未见 提交于 2019-12-24 14:33:01
问题 I'm programming in Greenfoot for a school project and I keep getting this error: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1 at java.util.ArrayList.rangeCheck( at java.util.ArrayList.get( at Speler.act( at greenfoot.core.Simulation.actActor( at greenfoot.core.Simulation.runOneLoop( at greenfoot.core.Simulation.runContent( at

Progress bar with 2 Indicators

守給你的承諾、 提交于 2019-11-29 19:57:15
问题 I want to have progress bar with 2 indicators. One indicator shows progress of task A in color green, the second indicator shows progress of task B in red, all in one progress bar. The rest shows the remaining of tasks A and B. Is there a (simple) solution to achieve this? I read the documentation but did not find help. 回答1: This can be done by coding the two indicators as the Primary progress and secondary progress of the same progress bar. create a sub class for the progress bar. public