import javax.swing.*;
import ij.*;
import ij.plugin.filter.PlugInFilter;
import ij.process.*;
import ij.gui.*;
import java.awt.*;
import ij.plugin.filter.*;
import java.awt.event.*;

public class fftFrame extends JFrame implements ActionListener {
	JPanel pnl=new JPanel();
	JLabel lbl=new JLabel("When the noise correction is finished,\n"+
							"apply the Inverse FFT");
	JButton apply=new JButton("Apply Inverse FFT");
	boolean pnl_visibility=false;
	ImagePlus spectrum;
	
	public fftFrame() {
		super();
		
		this.setTitle("Fourier Elaboration Panel");
		this.setSize(450, 100);
		
		apply.addActionListener(this);
		
		this.getContentPane().setLayout(new GridLayout());	
		
		pnl.add(lbl);
		pnl.add(apply);
		this.getContentPane().add(pnl);
	}
	
	public void actionPerformed(ActionEvent evt) {
		this.spectrum=WindowManager.getCurrentImage();
		IJ.run(spectrum, "Inverse FFT", "");
		this.pnl_visibility=false;
		this.setVisible(false);
	}
}
