package class8_2_BlurringWithBufferedImage; import javax.swing.*; public class ImageGUI extends JFrame { public ImageGUI() { final VideoImagePanel videoPanel = new VideoImagePanel(); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // Important step -- without it, more and more instances fill // memory until computer crashes/user takes action setTitle("Video Filterer"); // setSize(512,512+100); // TODO: How to make window fit its contents? JMenuBar menuBar = new JMenuBar(); JMenu menu = new JMenu("Program"); JMenuItem menuItem = new JMenuItem("Start"); // TODO: Start the blurrer when the start button is pressed. // Step 1. Although it won't run, write a line of code that // creates a new ActionListener and passes it to the menu item. // // Step 2. Supply the missing class body to this action listener. menu.add(menuItem); menuBar.add(menu); menuBar.setSize(512,40); setJMenuBar(menuBar); add(videoPanel); pack(); // Make frame fit contents. setVisible(true); } public static void main(String[] ignored) { new ImageGUI(); } }