tag:blogger.com,1999:blog-1661517518925762010.post428758985920964904..comments2023-11-30T22:48:28.111-08:00Comments on Java-Buddy: Detect mouse click on JavaFX TableView and get the details of the clicked itemErikhttp://www.blogger.com/profile/04983894331825656853noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-1661517518925762010.post-74559925260230232042013-05-16T21:27:17.361-07:002013-05-16T21:27:17.361-07:00hello,
Please read Update ObservableList for Tabl...hello,<br /><br />Please read <a href="http://java-buddy.blogspot.com/2013/05/update-observablelist-for-tableview-in.html" rel="nofollow">Update ObservableList for TableView, in UI thread and background thread.</a>.Anonymoushttps://www.blogger.com/profile/02036390354033315722noreply@blogger.comtag:blogger.com,1999:blog-1661517518925762010.post-83670886856434872312013-05-16T09:52:21.463-07:002013-05-16T09:52:21.463-07:00Nice example! but i have a question. Will this cod...Nice example! but i have a question. Will this code work for a table created in a task thread not in a main thread?? Anonymoushttps://www.blogger.com/profile/11339436399171180683noreply@blogger.comtag:blogger.com,1999:blog-1661517518925762010.post-69083521912567764852013-05-14T13:18:57.614-07:002013-05-14T13:18:57.614-07:00This comment has been removed by a blog administrator.aymenhttps://www.blogger.com/profile/00600191589527003578noreply@blogger.comtag:blogger.com,1999:blog-1661517518925762010.post-10915244485262647132013-05-14T09:46:11.327-07:002013-05-14T09:46:11.327-07:00I think it's not difficult to add record in re...I think it's not difficult to add record in recordList by calling recordList.add(new Record(...)).<br /><br />ObservableList object enables the tracking of any changes to its elements, the TableView content automatically updates whenever the data changes.Anonymoushttps://www.blogger.com/profile/02036390354033315722noreply@blogger.comtag:blogger.com,1999:blog-1661517518925762010.post-62587594324719607112013-05-14T08:59:31.580-07:002013-05-14T08:59:31.580-07:00Well, here is yur problem, yu're filling yur t...Well, here is yur problem, yu're filling yur tableview statically not from a database so it's a little bit harder to get a value ^^ especially when it's not the same implementing method that has been used ^^aymenhttps://www.blogger.com/profile/00600191589527003578noreply@blogger.comtag:blogger.com,1999:blog-1661517518925762010.post-82786492597759256242013-05-13T17:28:48.347-07:002013-05-13T17:28:48.347-07:00Is it means what I get in the example is what you ...Is it means what I get in the example is what you expect? <br /><br />In my code, I addEventFilter on each cell using CellFactory, that means there are many EventHandlers for many objects of cell. So you can get the clicked object of cell using t.getSource() in EventHandler. The returned object is TableCell.<br /><br />In your code, setOnMouseClicked for tableview. That means the source of event is the whole tableview, not individual cell.<br /><br />I modify the code from the example of Edit Cell in http://docs.oracle.com/javafx/2/ui_controls/table-view.htmAnonymoushttps://www.blogger.com/profile/02036390354033315722noreply@blogger.comtag:blogger.com,1999:blog-1661517518925762010.post-47068610284872152242013-05-13T12:25:21.828-07:002013-05-13T12:25:21.828-07:00hi man !!
ah thx again i just thought that i can o...hi man !!<br />ah thx again i just thought that i can only resize by bounding the imageview ^^<br />So this time, it's basically me stuck with the getting of a single value when selecting a row in my tableview<br />http://upload-pics.org/images/04163967738299484431.png<br />as yu can see, what i get is the full row not just items !<br />Yes, i saw the post of detecting the mouse click and...<br />but didn't get it well !!<br /><br />Here's the code i wrote !!<br />public void getValues(){<br /> tableview.setOnMouseClicked(new EventHandler(){<br /><br /> @Override<br /> public void handle(MouseEvent t) {<br /> ObservableList table = FXCollections.observableArrayList();<br /> for(int i = 0;i<=tableview.getColumns().size();i++){<br /> table.add(tableview.getSelectionModel().getSelectedItems().get(0).toString());<br /> }<br /> t1.setText(table.get(0));<br /> t2.setText(table.get(1));<br /> t3.setText(table.get(2));<br /> t4.setText(table.get(3));<br /> t5.setText(table.get(4));<br /> t6.setText(table.get(5));<br /> <br /> <br /> }<br /> <br /> <br /> });<br /> }<br /><br />all i'm trying to get is the id coloumn value when i click on a row ^^<br />Plz i've been really doing some search but as you know, javafx is a new approach of programming, not easy, not very found in topics and a little hard ^^aymenhttps://www.blogger.com/profile/00600191589527003578noreply@blogger.comtag:blogger.com,1999:blog-1661517518925762010.post-81748680046602847852013-05-13T09:22:33.992-07:002013-05-13T09:22:33.992-07:00Do you want code to resize image? Load a re-sized ...Do you want code to resize image? <a href="http://java-buddy.blogspot.com/2013/01/load-re-sized-image.html" rel="nofollow">Load a re-sized image</a>.<br /><br />For ComboBox, I have to study it first. I'm a beginner also.Anonymoushttps://www.blogger.com/profile/02036390354033315722noreply@blogger.comtag:blogger.com,1999:blog-1661517518925762010.post-37159713088656248782013-05-13T08:36:01.712-07:002013-05-13T08:36:01.712-07:00really sorry for that ^^ but basically i'm a b...really sorry for that ^^ but basically i'm a bit of new to javafx, and just linking the tableview and the database was so hard that i almost destroyed my pc ^^<br />and like i first posted, a little help with the combobox not wanting to display images when selecting elements, it just shows me hexa code !!<br />Last but not list, i just writen a code of resizing an image before sending it to the database in displaing it in the imageview, problem is that i'm resizing the imageview not the image, and i want after the resize process to upload the image to my database ??<br />Is there a way of fixing this ??aymenhttps://www.blogger.com/profile/00600191589527003578noreply@blogger.com