import java.awt.event.*;
import javax.swing.AbstractButton;

public class MenuViewListener implements ActionListener, ItemListener
{
	//#################################
	private MyFiles files;

	//#################################
	public MenuViewListener(MyFiles f)
	{
		files = f;
	}

	//#################################
	public void actionPerformed(ActionEvent e)
	{
		//JMenuItem menuItem = (JMenuItem)(e.getSource());
		String text = e.getActionCommand();
		//String text = menuItem.getText();
		if(text.equals("All"))
		{
			System.out.print("View1:");
			
		}
		if(text.equals("Movies"))
		{
			System.out.print("View2:");
		}
		System.out.println(" "+text);
	}

	public void itemStateChanged(ItemEvent e) {
		AbstractButton aButton = (AbstractButton) e.getSource();
		int state = e.getStateChange();		 // 1: selected | 2: not selected
		String label = aButton.getText();
		System.out.println("aButton.getText(): "+label);	// button selected
		System.out.println("e.getStateChange(): "+state);	// 1: selected | 2: not selected
		
	}
}
