From 3b41d15a9ed265cc0dab6b9032aeccfdb507140f Mon Sep 17 00:00:00 2001 From: tcofoegbu Date: Thu, 20 Apr 2017 18:48:28 +0100 Subject: [PATCH] JAL-2484 minor house-keeping --- src/jalview/io/cache/JvCacheableInputBox.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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); } /** -- 1.7.10.2