From 0a567b37fc63cbddb414749aa5fd0ed16f1c6461 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Fri, 12 May 2017 14:56:21 +0100 Subject: [PATCH] JAL-2388 checkbox in overview popup for applet --- src/jalview/appletgui/OverviewPanel.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/jalview/appletgui/OverviewPanel.java b/src/jalview/appletgui/OverviewPanel.java index 8c2b54b..b933d30 100755 --- a/src/jalview/appletgui/OverviewPanel.java +++ b/src/jalview/appletgui/OverviewPanel.java @@ -27,15 +27,15 @@ import jalview.viewmodel.OverviewDimensionsHideHidden; import jalview.viewmodel.OverviewDimensionsShowHidden; import java.awt.BorderLayout; +import java.awt.CheckboxMenuItem; 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.ItemEvent; +import java.awt.event.ItemListener; import java.awt.event.MouseEvent; import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; @@ -208,19 +208,19 @@ public class OverviewPanel extends Panel implements Runnable, private void showPopupMenu(MouseEvent e) { PopupMenu popup = new PopupMenu(); - ActionListener menuListener = new ActionListener() + ItemListener menuListener = new ItemListener() { @Override - public void actionPerformed(ActionEvent event) + public void itemStateChanged(ItemEvent e) { - // switch on/off the hidden columns view toggleHiddenColumns(); } }; - MenuItem item = new MenuItem( + CheckboxMenuItem item = new CheckboxMenuItem( MessageManager.getString("label.togglehidden")); + item.setState(showHidden); popup.add(item); - item.addActionListener(menuListener); + item.addItemListener(menuListener); this.add(popup); popup.show(this, e.getX(), e.getY()); } -- 1.7.10.2