tag:blogger.com,1999:blog-1661517518925762010.post3064696093318568585..comments2023-11-30T22:48:28.111-08:00Comments on Java-Buddy: Implement JavaFX ListView for custom objectErikhttp://www.blogger.com/profile/04983894331825656853noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-1661517518925762010.post-88182426824739671642013-07-31T05:43:44.950-07:002013-07-31T05:43:44.950-07:00Simply overriding the toString() method of your ob...Simply overriding the toString() method of your object would achieve same result.nCrazedhttps://www.blogger.com/profile/06959860581358870117noreply@blogger.comtag:blogger.com,1999:blog-1661517518925762010.post-8785554159515887812013-07-15T09:56:05.238-07:002013-07-15T09:56:05.238-07:00I think part of my problem is understanding where ...I think part of my problem is understanding where the "p" object from "ListView p" is used after it is initialized. I didn't see it anywhere else in the code, so I probably didn't include it where I should have.<br /><br />Here is a link to my code: http://pastebin.com/jf6JCSemAnonymoushttps://www.blogger.com/profile/15541128233313584537noreply@blogger.comtag:blogger.com,1999:blog-1661517518925762010.post-4932953358086373762013-07-12T20:56:32.889-07:002013-07-12T20:56:32.889-07:00Try to use setCellFactory() method, instead of ce...Try to use setCellFactory() method, instead of cellFactoryProperty().<br /><br />remark: I think there should be some < symbol removed by blogger, so I can'r view your full code!Anonymoushttps://www.blogger.com/profile/02036390354033315722noreply@blogger.comtag:blogger.com,1999:blog-1661517518925762010.post-77525458235255515682013-07-12T14:15:16.610-07:002013-07-12T14:15:16.610-07:00I tried to implement this code in my own version a...I tried to implement this code in my own version and I got an error. I tried to lookup and understand the error myself, but to no avail. Perhaps you know what would trigger the error.<br /><br />method cellFactoryProperty in class ListView cannot be applied to given types;<br /><br /><br />ObservableList custObservableList = FXCollections.observableList(dataFile.customerList);<br /> ListView custListView = new ListView<>();<br /> custListView.setItems(custObservableList);<br /> custListView.cellFactoryProperty(new Callback, ListCell>(){<br /> @Override<br /> public ListCell call(ListView p) {<br /> <br /> ListCell cell = new ListCell(){<br /> <br /> @Override<br /> protected void updateItem(Customer custValue, boolean bln) {<br /> super.updateItem(custValue, bln);<br /> if (custValue != null) {<br /> setText(custValue.getName());<br /> }<br /> }<br /> <br /> };<br /> <br /> return cell;<br /> }<br /> });<br />Anonymoushttps://www.blogger.com/profile/15541128233313584537noreply@blogger.com