From: tcofoegbu Date: Thu, 20 Apr 2017 17:48:28 +0000 (+0100) Subject: JAL-2484 minor house-keeping X-Git-Tag: Release_2_10_2~3^2~45^2~12 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=3b41d15a9ed265cc0dab6b9032aeccfdb507140f;p=jalview.git JAL-2484 minor house-keeping --- diff --git a/src/jalview/io/cache/JvCacheableInputBox.java b/src/jalview/io/cache/JvCacheableInputBox.java index 3eb193e..6101bdd 100644 --- a/src/jalview/io/cache/JvCacheableInputBox.java +++ b/src/jalview/io/cache/JvCacheableInputBox.java @@ -12,6 +12,7 @@ import java.util.LinkedHashSet; import java.util.List; import java.util.Set; +import javax.swing.BorderFactory; import javax.swing.JComboBox; import javax.swing.JLabel; import javax.swing.JMenuItem; @@ -44,7 +45,6 @@ public class JvCacheableInputBox extends JComboBox final static int INPUT_LIMIT = 2; - final static String SPACE = " "; public JvCacheableInputBox(String cacheKey) { @@ -64,12 +64,11 @@ public class JvCacheableInputBox extends JComboBox */ private void initCachePopupMenu() { - add(popup); - setComponentPopupMenu(popup); pnlDefaultCache.setBackground(Color.WHITE); + pnlDefaultCache.setBorder(BorderFactory.createEmptyBorder(0, 19, 0, 0)); txtDefaultCacheSize.setPreferredSize(new Dimension(45, 20)); - lblDefaultCacheSize.setText(SPACE - + MessageManager.getString("label.default_cache_size")); + lblDefaultCacheSize.setText(MessageManager + .getString("label.default_cache_size")); // Force input to accept only Integer entries up to length - INPUT_LIMIT txtDefaultCacheSize.setDocument(new PlainDocument() { @@ -88,8 +87,6 @@ public class JvCacheableInputBox extends JComboBox txtDefaultCacheSize.setText(appCache.getCacheLmit(cacheKey)); pnlDefaultCache.add(lblDefaultCacheSize); pnlDefaultCache.add(txtDefaultCacheSize); - popup.insert(pnlDefaultCache, 0); - menuItemClearCache.setText(MessageManager .getString("action.clear_cached_items")); menuItemClearCache.addActionListener(new ActionListener() @@ -104,7 +101,10 @@ public class JvCacheableInputBox extends JComboBox } }); + popup.insert(pnlDefaultCache, 0); popup.add(menuItemClearCache); + setComponentPopupMenu(popup); + add(popup); } /**