JavaFX 2: Tables: display update after data update

That is all I need to answer my last question .

If you look at my last question, you will see my class containing four fields corresponding to the four columns of my table

public static class ContactOptions { private final StringProperty one; private final StringProperty two; private final StringProperty three; private final StringProperty four; ContactOptions(String col1, String col2, String col3, String col4) { this.one = new StringProperty(col1); this.two = new StringProperty(col2); this.three = new StringProperty(col3); this.four = new StringProperty(col4); } public String getOne() { return one.get(); } public String getTwo() { return two.get(); } public String getThree() { return three.get(); } public String getFour() { return four.get(); } } 

How do I get the GUI to update after running ContactOptions.one.set ?

When I scroll down and make a backup, it updates. How can I update it without scrolling.

I also asked about this at https://forums.oracle.com/forums/thread.jspa?threadID=2275725

+2
source share
3 answers

Perhaps you should use one of the following methods:

 updateTableColumn(TableColumn col) 

Updates the table associated with this TableCell.

 updateTableRow(TableRow tableRow) 

Updates the TableRow associated with this TableCell.

 updateTableView(TableView tv) 

Updates the TableView associated with this TableCell.

(From http://docs.oracle.com/javafx/2.0/api/javafx/scene/control/TableCell.html )

But I think that you have already dealt with this problem)

+2
source

For smooth updates to work, you must initialize each property and add the xxxProperty method:

 private final StringProperty one = new SimpleIntegerProperty(); public StringProperty oneProperty() { return one; } 

From my own experience, do not use property names using upperCase letters such as "myOne" or "myONE", since the xxxProperty method xxxProperty not be run.

+2
source

What JavaFX 2.0 build are you using? The reason I'm asking is because the tables have changed lately and I want to make sure that you are using the latest version.

+1
source

All Articles