Hi Damir,
Thanks for using Pivot!
Quick suggestion: can you just “select” the rows you are going
to import? That is very easy to do with methods like
“tableView.addSelectedIndex(int)” or “tableView.setSelectedRange(int, int)”.
~Roger
From: Damir Dezeljin [mailto:[email protected]]
Sent: Friday, October 18, 2013 3:15 AM
To: [email protected]
Subject: How to apply styles to TableView rows
Hello,
Last week I got a task to develop a simple Java application for importing Excel
files into MySQL database. As I didn't have experience with Java GUI, I did an
investigation and I choose Apache Pivot for developing the GUI toolking /
framework; I'll use Apache POI for reading Excel files.
The application I'm developing needs to load in an Excel spreadsheet and
display its data in a data grid format; a subset of displayed data needs to be
highlighted (colored) to denote what data is going to be imported into a DB.
I figured out the Apache Pivot TableView would meet my requirements for
displaying a data grid. So I created a TablePane in Java and added it to a
ScrollPane defined in a BXML file. Today I'll move also the TableView
definition into Java code as it needs to be dynamic.
Now I'm struggling finding the way how to highlight a certain rows. Various
posts mention the TableView CellRenderer has to be extended; however, I didn't
find the way or an example how to do it.
Can someone help me out with an example or hints how to implement it. In case I
need to extend a TablePane parrent which in my case is ScrollPane or any other
class by defining my own, I would appreciate an example how to use my own class
within a BXML file where all the GUI structure beside the TableView for data is
defined.
Thanks in advance,
Damir