indexing - JavaFX Check Cell background of specific Cell (random access) -


I just started to develop a Java FX application, I probably do not know how JavaFX uses TableView and I should use something different instead.

Currently my table view displays data in many columns when I change a cell background color (Custom Factory by SetSelfafaq).

Now I want to use different cells in the table by checking the index (column, row) and checking the background color. After clicking on a certain button, a changed background color cell must be stored.

I want to change every cell with each line (get celltext for each cell) and want to store it for later use in data structure, such as Maps and GT.

Really good if someone can give me an indication Thank you for your help.

I think you are adding an event handler to Tableclass, which is your customfactory this event handler DoubleClick -The event is dealing with and sets the background color, right? This handler has access to the parameter given to the callback / customfactory call method, which is the model-bean of the current line.

Then

after a certain button is clicked

>

You can get your information by checking the item: Each item's line-index is equivalent to the indicator of this item in the TableView #getItems

list

Edit

This is a code-example:

The model-bean used in the table-view :

  class model {private string property A; Private string property B; @logok.guuter private set & lt; String & gt; PropertiesClicked = new hashset & lt; & Gt; ();   

If you use Fax, then annotate them with Jawfix-Controls, @fxmail:

  Private TableView & lt; Model & gt; TableView; Private table column & lt; Model, string & gt; propertyAColumn; Private table column & lt; Model, string & gt; propertyBColumn;   

And if you want it for many columns, create more general cellfactures:

  propertyAColumn.setCellFactory ((value) - gt; {tableclay & Lt; model, string & gt; table cell = new tableclose & lt; model, string & gt; () {// override the methods you need}; table.SetOnMosCoLight (mouseAvent) - & gt; ; {If (mouseEvent.getButton (.) Equals (mouse button primary)) {if (mouseEvent.getClickCount () == 2 & amp;; Amp ;; tableCell.getStyleClass () contains ("buttonClick") ) {TableCell.getStyleClass (). Oden ( "Btnkliked"); tabular view. Gate Selekshnmodel (). GetSelectedItem (). GetPropertiesClicked (). Add ( "PropertyA");}}}); return table cell;});    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -