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

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -