我正在尝试undo button
使用stack
它来删除应用的效果,例如blur
等,但是当我尝试存储在其中pop out
的i出现问题时,请帮助我,在此先感谢!image
stack
应用效果:
if (e.getSource() == btnGrayscale) {
if (buffImage != null) {
Imagesteps.push(buffImage);
ImageEffects ie = new GrayscaleEffect();
buffImage = ie.GrayscaleEffect(buffImage);
Icon icon = new ImageIcon(buffImage);
lblImage.setIcon(icon);
statusBar.setText("Image is now Grayscaled");
}
}
UNDO方法:
if (e.getSource() == undoimageitem) {
BufferedImage temp = (BufferedImage) Imagesteps.pop();
Icon icon = new ImageIcon(temp);
lblImage.setIcon(icon);
statusBar.setText("Undo");
}