Browse Source

tabbedPane uppernode delete bug fix

Kevin Trometer 7 years ago
parent
commit
799647d7b7
2 changed files with 2 additions and 2 deletions
  1. 1 1
      src/ui/view/MyCanvas.java
  2. 1 1
      src/ui/view/UpperNodeCanvas.java

+ 1 - 1
src/ui/view/MyCanvas.java

@@ -340,7 +340,7 @@ public class MyCanvas extends JPanel implements MouseListener, MouseMotionListen
 					// Remove UpperNodeTab if UpperNode deleted
 					if (cps instanceof CpsUpperNode) {
 						JTabbedPane tabbedPane = (JTabbedPane) getParent().getParent().getParent();
-						for (int i = 3; i < tabbedPane.getTabCount(); i++) {
+						for (int i = 4; i < tabbedPane.getTabCount(); i++) {
 							if (((UpperNodeCanvas) ((JScrollPane) tabbedPane.getComponentAt(i)).getViewport()
 									.getComponent(0)).upperNode.getId() == cps.getId()) {
 								tabbedPane.remove(i);

+ 1 - 1
src/ui/view/UpperNodeCanvas.java

@@ -355,7 +355,7 @@ public class UpperNodeCanvas extends JPanel implements MouseListener, MouseMotio
 						// Remove UpperNodeTab if UpperNode deleted
 						if (cps instanceof CpsUpperNode) {
 							JTabbedPane tabbedPane = (JTabbedPane) getParent().getParent().getParent();
-							for (int i = 2; i < tabbedPane.getTabCount(); i++) {
+							for (int i = 4; i < tabbedPane.getTabCount(); i++) {
 								if (((UpperNodeCanvas) ((JScrollPane) tabbedPane.getComponentAt(i)).getViewport()
 										.getComponent(0)).upperNode.getId() == cps.getId()) {
 									tabbedPane.remove(i);