diff --git a/src/JavaFXGUI/EnterInfoTab.java b/src/JavaFXGUI/EnterInfoTab.java index 04f83b1..35edfae 100644 --- a/src/JavaFXGUI/EnterInfoTab.java +++ b/src/JavaFXGUI/EnterInfoTab.java @@ -89,15 +89,13 @@ public EnterInfoTab(MenuTabPane par, EnterStudentTab prev, String title, int page = -1; String stringData = ""; while(file.hasNext()){ - stringData = file.nextLine(); - System.out.println(stringData); - infoOptionSelect.removeChoiceBox(); + System.out.println(stringData+ ", " + v + ", " + version); + if (stringData.equals("+++")){ - v ++; - infoOptionSelect.removeChoiceBox(); + v++; } - else if (stringData.equals("++")&& version == v){ + else if (stringData.equals("++") && version == v){ page++; stringData = file.nextLine(); if (stringData.contains("Submit Button")){ @@ -107,37 +105,32 @@ else if (stringData.equals("++")&& version == v){ else{ infoOptionSelect.addPage(stringData); } - infoOptionSelect.removeChoiceBox(); } else if (stringData.equals("++++")){ - v++; stringData=file.nextLine(); if (stringData.contains("Submit Button")){ String[] stringDatas = stringData.split(", "); infoOptionSelect.addSubmitButton(page); infoOptionSelect.addPage(stringDatas[1]); - String title1 = stringDatas[1]; - ArrayList data1 = new ArrayList(); + ArrayList data = new ArrayList(); stringData = file.nextLine(); while(!stringData.equals("Title 2")){ - data1.add(stringData); + data.add(stringData); stringData = file.nextLine(); } - String title2 = file.nextLine(); stringData = file.nextLine(); ArrayList data2 = new ArrayList(); while(!stringData.equals("End")){ data2.add(stringData); stringData=file.nextLine(); - } - infoOptionSelect.splitScreen(page+1, title1, title2, data1, data2, infoOptionSelect); - } - infoOptionSelect.removeChoiceBox(); + } + infoOptionSelect.splitScreen(page+1, data); + }//infoOptionSelect.removeChoiceBox(); + } else if (version == v){ infoOptionSelect.addButton(page, stringData, stringData); - infoOptionSelect.removeChoiceBox(); } } file.close(); diff --git a/src/JavaFXGUI/OptionSelect.java b/src/JavaFXGUI/OptionSelect.java index 26519de..720c763 100644 --- a/src/JavaFXGUI/OptionSelect.java +++ b/src/JavaFXGUI/OptionSelect.java @@ -210,23 +210,21 @@ else if (buttonList.get(page).size() == 1){ buttonVBox.getChildren().add(optionHBoxArray.get(page)); } - public void splitScreen(int page, String title1, String title2, ArrayList data1, ArrayList data2, OptionSelect o){ + public void splitScreen(int page, ArrayList data){ ArrayList left = new ArrayList(); - for(int i =0;i