java - Float from a binary file into TextField? -
i have binary file i'm reading , want balance file , input textfield. variable float, how that?
specifically part of code.
while(true){ st = (savedtrans) ois.readobject(); viewtable.addrow(new object[] {st.getdate(), st.getdrop(), st.getcheckno(), st.getdescription(), st.getdeposit(), st.getwithdraw(), st.getbalance()} ); if(st == null){ break; } i'm trying st.getbalance() display on textfield, possible way?
jtextfield inherits jtextcomponent class, therefore should have access settext() method. may not elegant solution, given information available code, method requires string type parameter, pass jtextfield.settext(float.tostring((float)st.getbalance()));
Comments
Post a Comment