It's only reading every other line. It's supposed to print out:
28
80.0
22
1
2
2
3
1
3
But it's only reading:
80.0
1
2
1
//Load button - #=daynum, $=wallet, @=inventory, &=employees, !=customers
if (btn2.getText().equals("Load")){
int id=0;
File file = new File("savefile1.txt");
BufferedReader reader = null;
try {
reader = new BufferedReader(new FileReader(file));
String text = null;
while ((text = reader.readLine()) != null) {
text = reader.readLine();
if (text.contains("#")){
text=text.replace("#", "");
dayNum=Integer.parseInt(text);
}
if (text.contains("$")){
text=text.replace("$", "");
wallet=Double.parseDouble(text);
}
if (text.contains("!")){
text=text.replace("!", "");
customer.setCustTotalComplete(Integer.parseInt(text));
}
if (text.contains("@")){
text=text.replace("@", "");
id=Integer.parseInt(text);
BuyInvItem(id);
inventory.setNewInv(InvId[id],
InvPrice[id],
InvName[id],
InvSellPrice[id],
InvAmt[id],
InvBuyPrice[id], id);
}
if (text.contains("&")){
text=text.replace("&", "");
id=Integer.parseInt(text);
employee.setNewEmp(EmpId[id],
EmpWage[id],
EmpName[id],
EmpSpeed[id],
id);
}
}//end while
MainText();
UpdateEmpDisplay();
UpdateInvDisplay();
txtSide.setText(MainText);
}//end try
catch (FileNotFoundException f) {
f.printStackTrace();
JOptionPane.showMessageDialog(null, "Save file not found");
}
catch (IOException f) {
f.printStackTrace();
JOptionPane.showMessageDialog(null, "There was an error loading the file");
}
catch (NullPointerException f){
JOptionPane.showMessageDialog(null, "File loaded successfully");
}
finally {
try {
if (reader != null) {
reader.close();
}
} catch (IOException f) {
f.printStackTrace();
}
}
}
HELP ME PLZ