import java.awt.BorderLayout;
import java.awt.Dimension;
+import java.awt.MenuItem;
import java.awt.Panel;
+import java.awt.PopupMenu;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ComponentAdapter;
import java.awt.event.ComponentEvent;
+import java.awt.event.InputEvent;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.awt.event.MouseMotionListener;
-import javax.swing.JMenuItem;
-import javax.swing.JPopupMenu;
-import javax.swing.SwingUtilities;
-
public class OverviewPanel extends Panel implements Runnable,
MouseMotionListener, MouseListener
{
@Override
public void mouseClicked(MouseEvent evt)
{
- if (SwingUtilities.isRightMouseButton(evt))
+ if ((evt.getModifiers() & InputEvent.BUTTON3_MASK) == InputEvent.BUTTON3_MASK)
{
showPopupMenu(evt);
}
private void mouseAction(MouseEvent evt)
{
- if (SwingUtilities.isRightMouseButton(evt))
+ if ((evt.getModifiers() & InputEvent.BUTTON3_MASK) == InputEvent.BUTTON3_MASK)
{
if (!Platform.isAMac())
{
*/
private void showPopupMenu(MouseEvent e)
{
- JPopupMenu popup = new JPopupMenu();
+ PopupMenu popup = new PopupMenu();
ActionListener menuListener = new ActionListener()
{
@Override
toggleHiddenColumns();
}
};
- JMenuItem item = new JMenuItem(
+ MenuItem item = new MenuItem(
MessageManager.getString("label.togglehidden"));
popup.add(item);
item.addActionListener(menuListener);
+ this.add(popup);
popup.show(this, e.getX(), e.getY());
}