From 2f1fa81a583b88822b5e22cd060dd451cbd2763d Mon Sep 17 00:00:00 2001 From: Holt59 Date: Sat, 3 Mar 2018 22:44:30 +0100 Subject: [PATCH] Resize path panel correctly when removing a path. --- src/main/org/insa/graphics/PathsPanel.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/org/insa/graphics/PathsPanel.java b/src/main/org/insa/graphics/PathsPanel.java index 66d6f12..8969310 100644 --- a/src/main/org/insa/graphics/PathsPanel.java +++ b/src/main/org/insa/graphics/PathsPanel.java @@ -166,11 +166,12 @@ public class PathsPanel extends JPanel implements DrawingChangeListener, GraphCh this.add(new PathPanel(path)); this.setVisible(true); this.revalidate(); + this.repaint(); } protected void removePath(PathPanel panel) { PathsPanel.this.remove(panel); - PathsPanel.this.validate(); + PathsPanel.this.revalidate(); PathsPanel.this.repaint(); if (this.getComponentCount() == 0) { this.setVisible(false);