focus handling fix, improved "can insert" detection

This commit is contained in:
Gregory.Shrago
2012-07-03 22:01:19 +04:00
parent 842ebc1a64
commit 030aa07cf3
@@ -52,6 +52,8 @@ public class ComponentWithBrowseButton<Comp extends JComponent> extends JPanel i
public ComponentWithBrowseButton(Comp component, @Nullable ActionListener browseActionListener) {
super(new BorderLayout(SystemInfo.isMac? 0 : 2, 0));
myComponent = component;
// required! otherwise JPanel will occasionally gain focus instead of the component
setFocusable(false);
add(myComponent, BorderLayout.CENTER);
myBrowseButton=new FixedSizeButton(myComponent);