import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Graphics;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTable;

public class Screen extends JPanel{
	
	JScrollPane scrollPane;
	final int clear = 44;
	
	public Screen(){
		JFrame jframe = new JFrame();
		JMenuBar menuBar = new JMenuBar();
		JMenu menu = new JMenu("Homeworks");
		JMenu menu1 = new JMenu("Homework 1");
		JMenu menu2 = new JMenu("Homework 2");
		JMenu menu3 = new JMenu("Homework 3");
		JMenu menu4 = new JMenu("Homework 4");
		JMenu menu5 = new JMenu("Homework 5");
		JMenu menu6 = new JMenu("Homework 6");
		JMenu menu7 = new JMenu("Homework 7");
		JMenu menu8 = new JMenu("Homework 8");
		JMenu menu9 = new JMenu("Homework 9");
		JMenu menu10 = new JMenu("Homework 10");
		JMenuItem hw1mI1 = new JMenuItem("part 1");
		JMenuItem hw1mI2 = new JMenuItem("part 2");
		JMenuItem hw1mI3 = new JMenuItem("part 3");
		JMenuItem hw1mI4 = new JMenuItem("part 4");
		JMenuItem hw2mI1 = new JMenuItem("part 1");
		JMenuItem hw2mI2 = new JMenuItem("part 2");
		JMenuItem hw2mI3 = new JMenuItem("part 3");
		JMenuItem hw3mI1 = new JMenuItem("part 1");
		JMenuItem hw4mI1 = new JMenuItem("part 1");
		JMenuItem hw5mI1 = new JMenuItem("part 1");
		JMenuItem hw6mI1 = new JMenuItem("part 1");
		JMenuItem hw7mI1 = new JMenuItem("part 1");
		JMenuItem hw8mI1 = new JMenuItem("part 1");
		JMenuItem hw9mI1 = new JMenuItem("part 1");
		JMenuItem hw10mI1 = new JMenuItem("part 1");
		menu1.add(hw1mI1);
		menu1.add(hw1mI2);
		menu1.add(hw1mI3);
		menu1.add(hw1mI4);
		menu2.add(hw2mI1);
		menu2.add(hw2mI2);
		menu2.add(hw2mI3);
		menu3.add(hw3mI1);
		menu4.add(hw4mI1);
		menu5.add(hw5mI1);
		menu6.add(hw6mI1);
		menu7.add(hw7mI1);
		menu8.add(hw8mI1);
		menu9.add(hw9mI1);
		menu10.add(hw10mI1);
		menu.add(menu1);
		menu.add(menu2);
		menu.add(menu3);
		menu.add(menu4);
		menu.add(menu5);
		menu.add(menu6);
		menu.add(menu7);
		menu.add(menu8);
		menu.add(menu9);
		menu.add(menu10);
		
		// CG2 menus
		JMenu menu11 = new JMenu("Binary Thresholding");
		JMenu menu12 = new JMenu("Histogram Stretching");
		JMenu menu13 = new JMenu("Histogram Equalization");
		JMenu menu14 = new JMenu("Histogram Matching");
		JMenu menu15 = new JMenu("Unsharp Masking");
		JMenu menu16 = new JMenu("Image Convolution");
		JMenu menu17 = new JMenu("Image Steganography");
		
		JMenuItem hw11mI1 = new JMenuItem("part 1");
		JMenuItem hw11mI2 = new JMenuItem("part 2");
		JMenuItem hw12mI1 = new JMenuItem("part 1");
		JMenuItem hw12mI2 = new JMenuItem("part 2");
		JMenuItem hw12mI3 = new JMenuItem("part 3");
		JMenuItem hw13mI1 = new JMenuItem("part 1");
		JMenuItem hw13mI2 = new JMenuItem("part 2");
		JMenuItem hw14mI1 = new JMenuItem("part 1");
		JMenuItem hw14mI2 = new JMenuItem("part 2");
		JMenuItem hw15mI1 = new JMenuItem("part 1");
		JMenuItem hw16mI1 = new JMenuItem("part 1");
		JMenuItem hw16mI2 = new JMenuItem("part 2");
		JMenuItem hw16mI3 = new JMenuItem("part 3");
		JMenuItem hw17mI1 = new JMenuItem("part 1");
		
		menu11.add(hw11mI1);
		menu11.add(hw11mI2);
		menu12.add(hw12mI1);
		menu12.add(hw12mI2);
		menu12.add(hw12mI3);
		menu13.add(hw13mI1);
		menu13.add(hw13mI2);
		menu14.add(hw14mI1);
		menu14.add(hw14mI2);
		menu15.add(hw15mI1);
		menu16.add(hw16mI1);
		menu16.add(hw16mI2);
		menu16.add(hw16mI3);
		menu17.add(hw17mI1);
		
		menu.add(menu11);
		menu.add(menu12);
		menu.add(menu13);
		menu.add(menu14);
		menu.add(menu15);
		menu.add(menu16);
		menu.add(menu17);
		
		menuBar.add(menu);
		jframe.setJMenuBar(menuBar);
		jframe.setTitle("CG_Unified_By_Saeed_Khosravi");
		jframe.setLocation(100, 150);
		jframe.setSize(new Dimension(1100, 600));
		jframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		jframe.setVisible(true);
		jframe.setResizable(false);
		
		Graphics g = jframe.getGraphics();
		hw1mI1.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent e) {
				CheckerboardImageGenerator hw = new CheckerboardImageGenerator();
				jframe.setTitle("hw1_A");
				g.clearRect(0, clear, 1200, 600);
				g.drawImage(hw.getImage(),100,100,jframe);
				g.drawImage(hw.getImage2(),600,100,jframe);
				
			}
		});
		hw1mI2.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent e) {

				jframe.setTitle("hw1_B");
				new CheckerboardImageGenerator();
				ImageAdditionInversion hw = new ImageAdditionInversion();
				g.clearRect(0, clear, 1200, 600);
				g.drawImage(hw.getImage3(),100,100,jframe);
				g.drawImage(hw.getImage4(),600,100,jframe);
				
			}
		});
		
		hw1mI3.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent e) {
				new CheckerboardImageGenerator();
				jframe.setTitle("hw1_C");
				g.clearRect(0, clear, 1200, 600);
				//resize hw.getImage2(); to 100*100;
				ImageResize hw1C = new ImageResize();
				g.drawImage(hw1C.getImage6(),350,100,jframe);
				
			}
		});
		
		hw1mI4.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent e) {
				jframe.setTitle("hw1_D");
				g.clearRect(0, clear, 1200, 600);
				ImageSubtraction hw = new ImageSubtraction();
				g.drawImage(hw.getImage6(),350,100,jframe);
				
			}
		});
		
		
		hw2mI1.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent e) {
				
				double c;
				c = 100;
				BrightnessContrastAdjustment hw = new BrightnessContrastAdjustment(c,1);
				jframe.setTitle("hw2_A");
				g.clearRect(0, clear, 1200, 600);
				g.drawImage(hw.getOriginalImage(), 300, 100, jframe);
				g.drawImage(hw.getImage(),600,100,jframe);
				
			}
		});
		
		hw2mI2.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent e) {
				
				
				jframe.setTitle("hw2_B");
				g.clearRect(0, clear, 1200, 600);
				ImageBlending hw = new ImageBlending();
				g.drawImage(hw.getcarImage(),100,50,jframe);
				g.drawImage(hw.getcar2Image(),100,225,jframe);
				g.drawImage(hw.getcar3Image(),100,400,jframe);
				g.drawImage(hw.getImage(),	600, 225, jframe);
			}
		});

		hw2mI3.addActionListener(new ActionListener() {
	
			@Override
			public void actionPerformed(ActionEvent e) {
				double c;
				c = 1.5;
				BrightnessContrastAdjustment hw = new BrightnessContrastAdjustment(c,2);
				jframe.setTitle("hw2_C");
				g.clearRect(0, clear, 1200, 600);
				g.drawImage(hw.getOriginalImage(), 300, 100, jframe);
				g.drawImage(hw.getImage(),600,100,jframe);
				
			}
		});
		
		hw3mI1.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent e) {
				ImageCropFlip hw = new ImageCropFlip();
				jframe.setTitle("hw3");
				g.clearRect(0, clear, 1200, 600);
				g.drawImage(hw.getBalloon(), 10, 60, jframe);
				g.drawImage(hw.getImage(),10,450,jframe);
				g.drawImage(hw.getImage2(),250,450,jframe);
				g.drawImage(hw.getImage3(),490,450,jframe);
				g.drawImage(hw.getBalloonTemp(),550,60,jframe);
			}
		});
		
		hw4mI1.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent e) {
				GrayScalePattern hw = new GrayScalePattern();
				jframe.setTitle("hw4");
				g.clearRect(0, clear, 1200, 600);
				g.drawImage(hw.getImage(), 400, 150, jframe);
			}
		});
		
		hw5mI1.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent e) {
				BitPlaneSlicing hw = new BitPlaneSlicing();
				jframe.setTitle("hw5");
				g.clearRect(0, clear, 1200, 600);
				g.drawImage(hw.getImage(8), 10, 60, 220,200, jframe);
				g.drawImage(hw.getImage(7), 240, 60, 220,200, jframe);
				g.drawImage(hw.getImage(6), 470, 60, 220,200, jframe);
				g.drawImage(hw.getImage(5), 700, 60, 220,200, jframe);
				g.drawImage(hw.getImage(4), 10, 300, 220,200, jframe);
				g.drawImage(hw.getImage(3), 240, 300, 220,200, jframe);
				g.drawImage(hw.getImage(2), 470, 300, 220,200, jframe);
				g.drawImage(hw.getImage(1), 700, 300, 220,200, jframe);
				
			}
		});
		
		hw6mI1.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent e) {
				BlockAveraging hw = new BlockAveraging();
				jframe.setTitle("hw6");
				g.clearRect(0, clear, 1200, 600);
				g.drawImage(hw.getImage(1), 10, 60, 220,200, jframe);
				g.drawImage(hw.getImage(2), 240, 60, 220,200, jframe);
				g.drawImage(hw.getImage(3), 470, 60, 220,200, jframe);
				g.drawImage(hw.getImage(4), 700, 60, 220,200, jframe);
			}
		});
		hw7mI1.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent e) {
				ImageRotation hw = new ImageRotation();
				jframe.setTitle("hw7");
				g.clearRect(0, clear, 1200, 600);
				g.drawImage(hw.getImage(),250,100,jframe);
				g.drawImage(hw.getImageR(),550,100,jframe);
				
			}
		});
		
		hw8mI1.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent e) {
				ImageShearing hw = new ImageShearing();
				jframe.setTitle("hw8");
				g.clearRect(0, clear, 1200, 600);
				g.drawImage(hw.getImage(),250,100,jframe);
				g.drawImage(hw.getImageS(),550,100,jframe);
				
			}
		});
		hw9mI1.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent e) {
				ImageStitching hw = new ImageStitching();
				jframe.setTitle("hw9");
				g.clearRect(0, clear, 1200, 600);
				g.drawImage(hw.getImageI1(),100,50,324,270,jframe);
				g.drawImage(hw.getImageI2(),100,325,324,270,jframe);
				g.drawImage(hw.getImageO(),440,160,jframe);
				
				
			}
		});
		hw10mI1.addActionListener(new ActionListener() {
			
			@Override
			public void actionPerformed(ActionEvent e) {
				ImageMasking hw = new ImageMasking();
				jframe.setTitle("hw10");
				g.clearRect(0, clear, 1200, 600);
				g.drawImage(hw.getImage(),10,50,198,310,jframe);
				g.drawImage(hw.getImage2(),210,50,198,310,jframe);
				g.drawImage(hw.getImage3(),410,50,198,310,jframe);
				g.drawImage(hw.getImage4(),610,50,198,310,jframe);
				g.drawImage(hw.getImage5(),810,50,198,310,jframe);
				
				
			}
		});
		
		// CG2 action listeners
		hw11mI1.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				BinaryThresholding hw = new BinaryThresholding();
				jframe.setTitle("Binary Thresholding");
				g.clearRect(0, clear, 1200, 600);
				g.drawImage(hw.getImage(),100,100,450,250,jframe);
				new Histogram(hw.getImageHistogram(),jframe.getGraphics(), 450, 590, 230);
				g.drawImage(hw.getImage2(),560,100,450,250,jframe);
				if(scrollPane!= null)
					jframe.remove(scrollPane);
			}
		});
		
		hw11mI2.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				BinaryThresholding hw = new BinaryThresholding();
				jframe.setTitle("Binary Thresholding");
				g.clearRect(0, clear, 1200, 600);
				g.drawImage(hw.getImage3(),100,100,450,250,jframe);
				new Histogram(hw.getImageHistogram2(),jframe.getGraphics(), 450, 590, 230);
				g.drawImage(hw.getImage4(),560,100,450,250,jframe);
				if(scrollPane!= null)
					jframe.remove(scrollPane);
			}
		});
		
		hw12mI1.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				HistogramStretching hw = new HistogramStretching();
				jframe.setTitle("Histogram Stretching");
				g.clearRect(0, clear, 1200, 600);
				g.setFont(new Font("Serif", Font.BOLD, 16));
				g.drawString("Original Image", 110, 65);
				g.drawImage(hw.getImage(),100,70,jframe);
				new Histogram(hw.getImageHistogram(),jframe.getGraphics(), 100, 590, 230);
				g.drawString("Histogram Strech [c = "+hw.getc()+",d = "+hw.getd()+"]", 410, 65);
				g.drawImage(hw.getImage2(),400,70,jframe);
				new Histogram(hw.getImageHistogram2(),jframe.getGraphics(), 400, 590, 230);
				g.drawString("Scaling by C = "+hw.getC(), 710, 65);
				g.drawImage(hw.getImage3(),700,70,jframe);
				new Histogram(hw.getImageHistogram3(),jframe.getGraphics(), 700, 590, 230);
				if(scrollPane!= null)
					jframe.remove(scrollPane);
			}
		});
		
		hw12mI2.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				HistogramStretching hw = new HistogramStretching();
				jframe.setTitle("Histogram Stretching");
				g.clearRect(0, clear, 1200, 600);
				g.setFont(new Font("Serif", Font.BOLD, 16));
				g.drawString("Original Image", 110, 65);
				g.drawImage(hw.getImage4(),100,70,jframe);
				new Histogram(hw.getImageHistogram4(),jframe.getGraphics(), 100, 590, 230);
				g.drawString("Log Normalization with C = "+hw.getC(), 410, 65);
				g.drawImage(hw.getImage5(),400,70,jframe);
				new Histogram(hw.getImageHistogram5(),jframe.getGraphics(), 400, 590, 230);
				g.drawString("P_Law Normalization C = "+hw.getC()+", Gamma = "+hw.getGamma(), 710, 65);
				g.drawImage(hw.getImage6(),700,70,jframe);
				new Histogram(hw.getImageHistogram6(),jframe.getGraphics(), 700, 590, 230);
				if(scrollPane!= null)
					jframe.remove(scrollPane);
			}
		});
		
		hw12mI3.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				HistogramStretching hw = new HistogramStretching();
				jframe.setTitle("Histogram Stretching");
				g.clearRect(0, clear, 1200, 600);
				g.setFont(new Font("Serif", Font.BOLD, 16));
				g.drawString("Original Image", 110, 65);
				g.drawImage(hw.getImage7(),100,70,326,200,jframe);
				new Histogram(hw.getImageHistogram7(),jframe.getGraphics(), 100, 590, 230);
				g.drawString("Log Normalization with C = "+hw.getC(), 440, 65);
				g.drawImage(hw.getImage8(),430,70,326,200,jframe);
				new Histogram(hw.getImageHistogram8(),jframe.getGraphics(), 430, 590, 230);
				g.drawString("P_Law Normalization C = "+hw.getC()+", Gamma = "+hw.getGamma(), 770, 65);
				g.drawImage(hw.getImage9(),760,70,326,200,jframe);
				new Histogram(hw.getImageHistogram9(),jframe.getGraphics(), 760, 590, 230);
				if(scrollPane!= null)
					jframe.remove(scrollPane);
			}
		});
		
		hw13mI1.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				HistogramEqualization hw = new HistogramEqualization();
				jframe.setTitle("Histogram Equalization");
				g.clearRect(0, clear, 1200, 600);
				g.setFont(new Font("Serif", Font.BOLD, 16));
				g.drawString("Original Image", 110, 65);
				g.drawImage(hw.getImage(),100,70,200,200,jframe);
				new Histogram(hw.getImageHistogram(),jframe.getGraphics(), 100, 590, 230);
				Object columns[] = { "f", "P(I)", "g - sigma(P(I))","g*max","PG" };
				JTable table = new JTable(hw.getTable(), columns);
				scrollPane = new JScrollPane(table);
				jframe.add(scrollPane, BorderLayout.EAST);
				jframe.setVisible(true);
				g.drawString("Histogram Equalization", 370, 65);
				g.drawImage(hw.getImage2(),360,70,200,200,jframe);
				new Histogram(hw.getImageHistogram2(),jframe.getGraphics(), 360, 590, 230);
			}
		});
		
		hw13mI2.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				HistogramEqualization hw = new HistogramEqualization();
				jframe.setTitle("Histogram Equalization");
				g.clearRect(0, clear, 1200, 600);
				g.setFont(new Font("Serif", Font.BOLD, 16));
				g.drawString("Original Image", 110, 65);
				g.drawImage(hw.getImage3(),100,70,jframe);
				new Histogram(hw.getImageHistogram3(),jframe.getGraphics(), 100, 590, 230);
				g.drawString("Histogram Equalization", 510, 65);
				g.drawImage(hw.getImage4(),500,70,jframe);
				new Histogram(hw.getImageHistogram4(),jframe.getGraphics(), 500, 590, 230);
				if(scrollPane!= null)
					jframe.remove(scrollPane);
			}
		});
		
		hw14mI1.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				HistogramMatching hw = new HistogramMatching();
				jframe.setTitle("Histogram Matching");
				g.clearRect(0, clear, 1200, 600);
				g.setFont(new Font("Serif", Font.BOLD, 16));
				g.drawString("Original Image", 110, 65);
				g.drawImage(hw.getImage(),100,70,380,280,jframe);
				new Histogram(hw.getHistogram(),jframe.getGraphics(), 100, 590, 230);
				g.drawString("Histogram Equalization", 510, 65);
				g.drawImage(hw.getImage2(),500,70,380,280,jframe);
				new Histogram(hw.getHistogram2(),jframe.getGraphics(), 500, 590, 230);
				if(scrollPane!= null)
					jframe.remove(scrollPane);
			}
		});
		
		hw14mI2.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				HistogramMatching hw = new HistogramMatching();
				jframe.setTitle("Histogram Matching");
				g.clearRect(0, clear, 1200, 600);
				g.setFont(new Font("Serif", Font.BOLD, 16));
				g.drawString("Pigeon Image", 20, 65);
				g.drawImage(hw.getImage3(),10,70,350,250,jframe);
				new Histogram(hw.getHistogram3(),jframe.getGraphics(), 10, 590, 230);
				g.drawString("Soldier Image", 380, 65);
				g.drawImage(hw.getImage4(),370,70,350,250,jframe);
				new Histogram(hw.getHistogram4(),jframe.getGraphics(), 370, 590, 230);
				g.drawString("Pigeon HM from Soldier H", 740, 65);
				g.drawImage(hw.getImage5(),730,70,350,250,jframe);
				new Histogram(hw.getHistogram5(),jframe.getGraphics(), 730, 590, 230);
				if(scrollPane!= null)
					jframe.remove(scrollPane);
			}
		});
		
		hw15mI1.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				UnsharpMasking hw = new UnsharpMasking();
				jframe.setTitle("Unsharp Masking");
				g.clearRect(0, clear, 1200, 600);
				g.setFont(new Font("Serif", Font.BOLD, 16));
				g.drawString("house Image", 20, 65);
				g.drawImage(hw.getImage(),10,70,350,250,jframe);
				g.drawString("blured house Image", 380, 65);
				g.drawImage(hw.getImage2(),370,70,350,250,jframe);
				g.drawString("house minus blured Image", 740, 65);
				g.drawImage(hw.getImage3(),730,70,350,250,jframe);
				g.drawString("unsharp masking Image", 20, 340);
				g.drawImage(hw.getImage4(),10,350,350,250,jframe);
				g.drawString("Unsharped image using blured image by convolution concept. ", 370, 350);
				if(scrollPane!= null)
					jframe.remove(scrollPane);
			}
		});
		
		hw16mI1.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				ImageConvolution hw = new ImageConvolution();
				jframe.setTitle("Image Convolution");
				g.clearRect(0, clear, 1200, 600);
				g.setFont(new Font("Serif", Font.BOLD, 16));
				g.drawString("house Image", 20, 60);
				g.drawImage(hw.getImage(),10,65,350,250,jframe);
				g.drawString("a kernel", 380, 60);
				g.drawImage(hw.getImage2(),370,65,350,250,jframe);
				g.drawString("b kernel", 740, 60);
				g.drawImage(hw.getImage3(),730,65,350,250,jframe);
				g.drawString("c kernel", 20, 335);
				g.drawImage(hw.getImage4(),10,340,350,250,jframe);
				g.drawString("d kernel", 380, 335);
				g.drawImage(hw.getImage5(),370,340,350,250,jframe);
				g.drawString("e kernel", 740, 335);
				g.drawImage(hw.getImage6(),730,340,350,250,jframe);
				if(scrollPane!= null)
					jframe.remove(scrollPane);
			}
		});
		
		hw16mI2.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				ImageConvolution hw = new ImageConvolution();
				jframe.setTitle("Image Convolution");
				g.clearRect(0, clear, 1200, 600);
				g.setFont(new Font("Serif", Font.BOLD, 16));
				g.drawString("f kernel", 20, 60);
				g.drawImage(hw.getImage7(),10,65,350,250,jframe);
				g.drawString("g kernel", 380, 60);
				g.drawImage(hw.getImage8(),370,65,350,250,jframe);
				g.drawString("h kernel", 740, 60);
				g.drawImage(hw.getImage9(),730,65,350,250,jframe);
				g.drawString("i kernel", 20, 335);
				g.drawImage(hw.getImage10(),10,340,350,250,jframe);
				g.drawString("j kernel", 380, 335);
				g.drawImage(hw.getImage11(),370,340,350,250,jframe);
				g.drawString("k kernel", 740, 335);
				g.drawImage(hw.getImage12(),730,340,350,250,jframe);
				if(scrollPane!= null)
					jframe.remove(scrollPane);
			}
		});
		
		hw16mI3.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				ImageConvolution hw = new ImageConvolution();
				jframe.setTitle("Image Convolution");
				g.clearRect(0, clear, 1200, 600);
				g.setFont(new Font("Serif", Font.BOLD, 16));
				g.drawString("l kernel", 20, 60);
				g.drawImage(hw.getImage13(),10,65,350,250,jframe);
				if(scrollPane!= null)
					jframe.remove(scrollPane);
			}
		});
		
		hw17mI1.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				ImageSteganography hw = new ImageSteganography();
				jframe.setTitle("Image Steganography");
				g.clearRect(0, clear, 1200, 600);
				g.setFont(new Font("Serif", Font.BOLD, 16));
				g.drawString("Cover Image", 20, 60);
				g.drawImage(hw.getImage(),10,65,350,250,jframe);
				g.drawString("Message Image", 380, 60);
				g.drawImage(hw.getImage2(),370,65,350,250,jframe);
				g.drawString("Message MSB 1", 740, 60);
				g.drawImage(hw.getImage3(),730,65,350,250,jframe);
				g.drawString("Message MSB 2", 20, 335);
				g.drawImage(hw.getImage4(),10,340,350,250,jframe);
				g.drawString("Message MSB 3", 380, 335);
				g.drawImage(hw.getImage5(),370,340,350,250,jframe);
				g.drawString("Reveal Image", 740, 335);
				g.drawImage(hw.getImage6(),730,340,350,250,jframe);
				if(scrollPane!= null)
					jframe.remove(scrollPane);
			}
		});
		
	}

}
