greenfoot

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(ArrayList.java:635) at java.util.ArrayList.get(ArrayList.java:411) at Speler.act(Speler.java:60) at greenfoot.core.Simulation.actActor(Simulation.java:583) at greenfoot.core.Simulation.runOneLoop(Simulation.java:541) at greenfoot.core.Simulation.runContent(Simulation.java:215) at greenfoot.core.Simulation.run(Simulation.java

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