import javax.swing.JTabbedPane; import java.awt.event.MouseListener; import java.awt.event.MouseEvent; /** * TabbedPanel holds all the drawing canvases together so you can have multiple * documents opened all at once. This gives you multiple worksheets to work with. **/ public class TabbedPanel extends JTabbedPane implements MouseListener { /** Creates a default TabbedPanel. **/ //public TabbedPanel(){} /** Creates a TabbedPanel witht a unique id **/ public TabbedPanel(int tabbedPlacement) { super(tabbedPlacement); addMouseListener(this); } /** If the mouse is pressed then change the currentFile id **/ public void mousePressed(MouseEvent e) { ControlClass.currentFile = ((JTabbedPane)e.getSource()).getSelectedIndex(); } /** Invoked when the mouse is clicked. **/ public void mouseClicked(MouseEvent e){} /** Invoked when the mouse has entered a component. **/ public void mouseEntered(MouseEvent e){} /** Invoked when the moues has exited a component. **/ public void mouseExited(MouseEvent e){} /** Invoked when the mouse has been released. **/ public void mouseReleased(MouseEvent e){} }