tableview

How to populate TableView with String Arraylist in JavaFX

自古美人都是妖i 提交于 2019-12-31 03:31:09
问题 I want to populate TableView with String, String I have only two columns. I couldn't do it. What I tried so far is: ObservableList<String> data = FXCollections.observableArrayList(); for (blabla){ data.addAll(Id,Name); } tableView.getItems().addAll(data); and nothing shows on table. But when I do tableView.getItems() and print it, I see the data I've added. But on table, nothing is shown. I create my columns as follows: TableColumn idColumn = new TableColumn("Id"); TableColumn nameColumn =

JavaFX TableView Objects with Maps

China☆狼群 提交于 2019-12-31 02:32:05
问题 So I have done some digging around on the JavaFx TableView and I have found some nice solutions to simple situations. This article provides a nice explanation of how to create a Table with a Person object and also shows how to create a Table using a Map. Here is my problem, let's say I have an Object Person that contains some simple member data and also a Map of Assignments to Grades. Example: public class Person { String firstName; String lastName; String age; Map<Assignment, Grade> map; } I

How to get TableHeaderRow from TableView nowadays in JavaFX?

霸气de小男生 提交于 2019-12-30 09:29:27
问题 I saw examples on how to get table header in many places with code TableHeaderRow header = (TableHeaderRow) tableView.lookup("TableHeaderRow"); like here: How to prevent TableView from doing TableColumn re-order in javaFX 8? But this code returns null for me. How to reach TableHeaderRow then? 回答1: The TableHeaderRow is created by the Skin and the default Skin is not created until css is applied. You could call applyCss after adding the TableView to a Scene and access the TableHeaderRow after

How to get TableHeaderRow from TableView nowadays in JavaFX?

可紊 提交于 2019-12-30 09:29:20
问题 I saw examples on how to get table header in many places with code TableHeaderRow header = (TableHeaderRow) tableView.lookup("TableHeaderRow"); like here: How to prevent TableView from doing TableColumn re-order in javaFX 8? But this code returns null for me. How to reach TableHeaderRow then? 回答1: The TableHeaderRow is created by the Skin and the default Skin is not created until css is applied. You could call applyCss after adding the TableView to a Scene and access the TableHeaderRow after

Placing an image into a JavaFX 2 table

六眼飞鱼酱① 提交于 2019-12-30 07:10:05
问题 I'm trying to do something pretty simple. I want to place an icon in a column for a particular row in a table. If it's a folder, display a folder icon. If it's a file, display a file icon. Does anyone know how to do this in JavaFX 2? I've tried so many things and this seems like it should be pretty simple or at least an example somewhere. 回答1: Okay so I had a huge dummy moment. Turns out that I had my image url path wrong. I did find a site that provides a great example for adding elements

Javafx 8 Tableview selection with checkbox

﹥>﹥吖頭↗ 提交于 2019-12-30 05:23:09
问题 I've set up a multiselection enabled tableview and am trying to attach a listener a checkbox inserted into a column to the selection model of the table. checkBoxTableColumn.setCellValueFactory( cellData -> { CheckBox checkBox = new CheckBox(); ObjectProperty<CheckBox> sop = new SimpleObjectProperty<CheckBox>(); sop.setValue(checkBox); sop.getValue().setText(""); sop.getValue().selectedProperty().addListener( (obsv, oldv, newv) -> { ArrayList<Job> tempSelectionArray = new ArrayList<>(); if

Get selected row from TableView

て烟熏妆下的殇ゞ 提交于 2019-12-29 09:58:07
问题 I have a TableView configured as follows: tableView.getSelectionModel().setCellSelectionEnabled(true); tableView.getSelectionModel().setSelectionMode(SelectionMode.MULTIPLE); I can get the selected cells by calling tableView.getSelectionModel().getSelectedCells() I can get the selected items by calling tableView.getSelectionModel().getSelectedItems() Unfortunately, it seems there is no method like above to get the selected rows.. What I want to achive is a table configured to select cells but

Tableview simple display value

爱⌒轻易说出口 提交于 2019-12-29 09:56:31
问题 I am a stduent and very beginner of swift3. In here, I just want to display "First","Second","Third" in the tableview and it does not look good. The tutorial from the youtube is swift2 and I try to convert into swift3. I think the problem is related to code: let Cell = self.tableView.dequeueReusableCell(withIdentifier: "Cell", for: indexPath) as UITableViewCell I try hard to search like https://www.codeschool.com/blog/2016/09/14/evolving-to-swift-3/ but I dont know what happen. The Xcode

TableView: Get Notified When Scroll Reaches Bottom/ Top of Table

二次信任 提交于 2019-12-29 09:40:09
问题 I can listen for scroll events: tableView.addEventFilter(javafx.scene.input.ScrollEvent.SCROLL, new EventHandler<javafx.scene.input.ScrollEvent>() { @Override public void handle(final javafx.scene.input.ScrollEvent scrollEvent) { System.out.println("Scrolled."); } }); But How can I be notified if the bottom/ top of the table is reached? 回答1: A simple way of doing this is to retrieve the ScrollBar using a lookup : ScrollBar tvScrollBar = (ScrollBar) tableView.lookup(".scroll-bar:vertical");

New Firebase retrieve data and put on the tableView (Swift)

无人久伴 提交于 2019-12-29 09:14:25
问题 I made a simple social media with new Firebase, and I successfully save string with database and image with storage, but when it comes to retrieve data back to the tableView the unusual things happen! all the images retrieve back randomly show up and continually shift, but other part shows perfectly or when I using return posts.count tableView shows no post. Hope someone can kindly give me some suggestion import UIKit import Firebase import FirebaseStorage class timelineTableViewController: