Back to index

moin  1.9.0~rc2
MenuAdapterButton.java
Go to the documentation of this file.
00001 /*
00002  * @(#)CommandChoice.java 5.1
00003  *
00004  */
00005 
00006 package CH.ifa.draw.util;
00007 
00008 import java.awt.*;
00009 import java.awt.event.*;
00010 import java.util.*;
00011 
00019 public class MenuAdapterButton
00020         extends Button implements ActionListener {
00021 
00022     PopupMenu menu;
00023 
00024     public MenuAdapterButton(PopupMenu m) {
00025        super(m.getLabel());
00026        menu = m;
00027        addActionListener(this);
00028     }
00029 
00030     public void actionPerformed(ActionEvent e) {
00031        menu.show(this, 0, 0);
00032     }
00033 }
00034 
00035