public void frameRemoved(FrameUpdateEvent e) {}
@Override
public void frameUpdateFinished(FrameUpdateEvent e) {
if(FrameManager.getInstance().getFrameCount() > 1){
Frame lastFrame = FrameManager.getInstance().getFrameAtIndex(Math.max(FrameManager.getInstance().getFrameCount() - 1, 0));
Frame lastFrame2 = FrameManager.getInstance().getFrameAtIndex(Math.max(FrameManager.getInstance().getFrameCount() - 2, 0));
if (e.getFrames()[e.getFrames().length - 1] == lastFrame
|| e.getFrames()[e.getFrames().length - 1] == lastFrame2) {
try {
setForegroundImage(FrameManager
.getInstance()
.getFrameAtIndex(
FrameManager.getInstance()
.getFrameCount() - 1).getFile());
} catch (IOException e1) {
e1.printStackTrace();
}
try {
setBackgroundImage(FrameManager
.getInstance()
.getFrameAtIndex(
FrameManager.getInstance()
.getFrameCount() - 2).getFile());
} catch (IOException e1) {
e1.printStackTrace();
}
}
}else if(FrameManager.getInstance().getFrameCount() > 0){
Frame lastFrame = FrameManager.getInstance().getFrameAtIndex(Math.max(FrameManager.getInstance().getFrameCount() - 1, 0));
if (e.getFrames()[e.getFrames().length - 1] == lastFrame) {
try {
setForegroundImage(FrameManager
.getInstance()