parsing a checkbox to boolean
hi guys,
im having some trouble. im trying to parse a checkbox to a boolean so that i can then save it to a text file. at the moment i have the current code which to me makes sense:
private void btnSaveLoanActionPerformed(java.awt.event.ActionEv ent evt) {
int loanid;
float loandur, loanrate, loanamnt, security;
boolean reinvest;
loanid = Integer.parseInt(txtLoanID.getText());
loandur = Float.parseFloat(txtLoanDur.getText());
loanrate = Float.parseFloat(txtLoanRate.getText());
loanamnt = Float.parseFloat(txtLoanAmount.getText());
security = Float.parseFloat(txtLoanSecurityAmount.getText());
reinvest = Boolean.parseBoolean(chkReinvest.isSelected());
}
all the text parsing works but the boolean one is telling me "method parseBoolean in class java.lang.Boolean cannot be applied to given types
required: java.lang.String
found: boolean"
and when i click the warning im given the option to create the method parseBoolean(boolean) in java.lang.Boolean but when i click it, it just takes me to the Boolean class and doesnt do anything...
its doing my head in if anyone could give me a hand ill be really appreciative :(nod):