diff --git a/src/name/mlopatkin/andlogview/ui/filterpanel/FilterPanel.java b/src/name/mlopatkin/andlogview/ui/filterpanel/FilterPanel.java index c564ba7a..af29d105 100644 --- a/src/name/mlopatkin/andlogview/ui/filterpanel/FilterPanel.java +++ b/src/name/mlopatkin/andlogview/ui/filterpanel/FilterPanel.java @@ -118,7 +118,8 @@ public void onFilterAdded(PanelFilterView newFilter) { buttonByFilter.put(newFilter, button); content.add(button); menuHandler.addPopup(button); - validate(); + revalidate(); + repaint(); } @Override diff --git a/src/name/mlopatkin/andlogview/ui/filterpanel/FilterPanelUi.java b/src/name/mlopatkin/andlogview/ui/filterpanel/FilterPanelUi.java index da1d5e90..11a6c397 100644 --- a/src/name/mlopatkin/andlogview/ui/filterpanel/FilterPanelUi.java +++ b/src/name/mlopatkin/andlogview/ui/filterpanel/FilterPanelUi.java @@ -30,6 +30,7 @@ import javax.swing.JViewport; import javax.swing.SwingConstants; import javax.swing.UIManager; +import javax.swing.border.EmptyBorder; /** * FilterPanel implementation. Generated class from WindowBuilder editor. @@ -48,6 +49,7 @@ class FilterPanelUi extends JPanel { protected final JViewport contentViewport; FilterPanelUi() { + setBorder(new EmptyBorder(5, 5, 5, 5)); setLayout(new BoxLayout(this, BoxLayout.LINE_AXIS)); setBackground(UIManager.getColor("ToolBar.background")); @@ -68,9 +70,9 @@ class FilterPanelUi extends JPanel { add(Box.createRigidArea(new Dimension(SEPARATOR_WIDTH, SEPARATOR_HEIGHT))); content = new JPanel(); + content.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 0)); content.setBackground(UIManager.getColor("ToolBar.background")); content.setBorder(UiHelper.NO_BORDER); - ((FlowLayout) content.getLayout()).setAlignment(FlowLayout.LEFT); JScrollPane scrollPane = new JScrollPane(content, JScrollPane.VERTICAL_SCROLLBAR_NEVER, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); scrollPane.setBorder(UiHelper.NO_BORDER);