tableview

JavaFX 8 : Iterate through TableView cells and get graphics

笑着哭i 提交于 2020-02-24 10:09:58
问题 I'm having troubles accessing the objects displayed in the TableColumn Here's the code snippet where I set the graphics of one Column. Only want to show the Name of the Person object: (Any better/easier way in doing that is welcome) ownerColumn .setCellFactory(new Callback<TableColumn<Site, Person>, TableCell<Site, Person>>() { @Override public TableCell<Site, Person> call( TableColumn<Site, Person> param) { TableCell<Site, Person> ownerCell = new TableCell<Site, Person>() { @Override

JavaFX 8 : Iterate through TableView cells and get graphics

↘锁芯ラ 提交于 2020-02-24 10:05:31
问题 I'm having troubles accessing the objects displayed in the TableColumn Here's the code snippet where I set the graphics of one Column. Only want to show the Name of the Person object: (Any better/easier way in doing that is welcome) ownerColumn .setCellFactory(new Callback<TableColumn<Site, Person>, TableCell<Site, Person>>() { @Override public TableCell<Site, Person> call( TableColumn<Site, Person> param) { TableCell<Site, Person> ownerCell = new TableCell<Site, Person>() { @Override

How to fill TableView with ObservableMap<KeyObject, ObservableList<CustomObject>> in JavaFX

守給你的承諾、 提交于 2020-02-04 22:22:47
问题 My Java programm produces a lot of data, with wich I construct individual ResultObject. Because only certain ResultsObjects will be of interest, I populate an ObservableHashMap<> with my results. The CustomObject consists of a handful ints + doubles and one JSONObject. With this CustomObject I want to map similar ResultObjects(which have certain properties in common) to that one CustomObject. While mapping and handling those results works as intended, I am pretty much helpless to populate a

How to fill TableView with ObservableMap<KeyObject, ObservableList<CustomObject>> in JavaFX

倾然丶 夕夏残阳落幕 提交于 2020-02-04 22:20:26
问题 My Java programm produces a lot of data, with wich I construct individual ResultObject. Because only certain ResultsObjects will be of interest, I populate an ObservableHashMap<> with my results. The CustomObject consists of a handful ints + doubles and one JSONObject. With this CustomObject I want to map similar ResultObjects(which have certain properties in common) to that one CustomObject. While mapping and handling those results works as intended, I am pretty much helpless to populate a

+/- quantity of products in Cart View Controller with buttons each on a TableViewCell, which gets default quantity as integer from an array

二次信任 提交于 2020-02-02 13:57:12
问题 i am developing an app that you could add items to the Cart from MenuVC, then you can go to CartVC to view what is on your cart and increase or decrease quantity of items to be ordered. I cant make quantity label to change, don't know if thats because i get quantity from an array? is it unmutable? Thank you for your help Here is my cell import UIKit class BasketCell: UITableViewCell { @IBOutlet weak var quantityLabel: UILabel! @IBOutlet weak var itemLabel: UILabel! @IBOutlet weak var

JavaFX TableColumn resize to fit cell content

帅比萌擦擦* 提交于 2020-02-01 17:38:45
问题 I'm looking for a way to resize a TableColumn in a TableView so that all of the content is visible in each cell (i.e. no truncation). I noticed that double clicking on the column divider's does auto fit the column to the contents of its cells. Is there a way to trigger this programmatically? 回答1: Digging through the javafx source, I found that the actual method called when you click TableView columns divider is /* * FIXME: Naive implementation ahead * Attempts to resize column based on the

Cell with NSAttributedString makes the scrolling of UITableView slow

不打扰是莪最后的温柔 提交于 2020-01-30 07:00:26
问题 I have a table view that contains multiple kinds of cells. One of them is a cell with a TextView and in this text view, I have to render an NSAttributedString from data. This has to be done on the main Thread according to Apple documentation: The HTML importer should not be called from a background thread (that is, the options dictionary includes NSDocumentTypeDocumentAttribute with a value of NSHTMLTextDocumentType). It will try to synchronize with the main thread, fail, and time out.

JavaFX: Disable horizontal scrollbar of TableView

久未见 提交于 2020-01-30 04:47:39
问题 I have the following question: I would like to disable the horizontal scrollbar of my TableView. It may not be visible, but also the TableView may not be scrolled horizontally either. The visibility of the horizontal scrollbar can be set in the CSS: .table-view *.scroll-bar:horizontal *.increment-button, .table-view *.scroll-bar:horizontal *.decrement-button { -fx-background-color: null; -fx-background-radius: 0; -fx-background-insets: 0; -fx-padding: 0; } .table-view *.scroll-bar:horizontal

How to put a checkmark after search

牧云@^-^@ 提交于 2020-01-25 12:02:24
问题 Im trying to put checkmarks after doing a search. I've seen some answers here but it doesn't work for me. Ive tried some of the answers but it will only make an error. Here's the code that I wrote. struct finalCheckednames { var name: String; var checkMark: Bool} class ShowBroadcastNamesViewController: UIViewController, UITableViewDelegate, UITableViewDataSource, UISearchBarDelegate { var nameslist = ["Mark","Chris", "James", "Sandra"] var myIndex = 0 var nameArray = String() var filteredData

Suming a specific TableView column/row in JavaFX

巧了我就是萌 提交于 2020-01-25 06:21:28
问题 I have done this in java where I sum the values of the price column/row. But I am wondering how to do this in JavaFX. I want to sum everything in column 1 and display it in a inputField , I used this to do it in java but how do you do this in JavaFX? tableview.getValueAt(i, 1).toString(); Here is what I'm trying to do: int sum = 0; for (int i = 0; i < tableview.getItems().size(); i++) { sum = sum + Integer.parseInt(tableview.getValueAt(i, 1).toString()); } sumTextField.setText(String.valueOf