Hi,
I've got a basic javax.swing.Timer that I use to repeat itself to darken an image over and over again. This should give a fade out effect for the image however the delay on this is set to 0010 which should be so quick however it takes half a second. Then the next time I run the program it is even slower. Anyone know how to speed this timer up or is there too much information/code to process?
static javax.swing.Timer slideEffectFadeOut1 = new javax.swing.Timer(0010, new ActionListener() {
public void actionPerformed(ActionEvent e) {
RescaleOp rop = new RescaleOp(effect, 0, null);
BufferedImage negative1 = rop.filter(image1, null);
if (slideshowAction == 0) {
resized1 = MainMenu.resize1(negative1, 670,552);
}
if (slideshowAction == 1) {
resized1 = MainMenu.resize1(negative1, screenWidth,screenHeight);
}
imageIcon1 = new ImageIcon(resized1);
imageLabel1.setIcon(imageIcon1);
imagePanel1.add(imageLabel1);
previewFrame.getContentPane().add(imagePanel1);
previewFrame.repaint();
previewFrame.validate();
effect = effect - 0.1f;
if (effect >= 0.0f) {
slideEffectFadeOut1.stop();
slideEffectFadeOut1.start();
}
if (effect < 0.0f) {
effect = 0.0f;
slideEffectFadeOut1.stop();
slideEffectFadeIn1.start();
}
}
});