Skip to content

Instantly share code, notes, and snippets.

View lunodesouza's full-sized avatar

Luno lunodesouza

View GitHub Profile
@james-d
james-d / ComboBoxSortableTable.java
Last active June 1, 2018 15:13
TableView that sorts either by clicking on the column headers or by selecting a column from a combo box.
import java.util.Arrays;
import java.util.Collections;
import javafx.application.Application;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.collections.FXCollections;
import javafx.collections.ListChangeListener;
@james-d
james-d / TableViewSample.java
Created December 2, 2013 21:02
TableView with context menu applied to table rows. Based on the example in the tutorial at http://docs.oracle.com/javafx/2/ui_controls/table-view.htm#CJAGAAEE. (I don't necessarily like the style of some of this, but wanted to keep changes to the standard example minimal.)
import java.util.Arrays;
import javafx.application.Application;
import javafx.beans.binding.Bindings;
import javafx.beans.property.SimpleStringProperty;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.Insets;
@Roland09
Roland09 / CustomTableMenuDemo.java
Created February 11, 2015 17:56
This is an example about how you can customize the table menu button in a JavaFX TableView with node finding using a style class. It works without reflection.
import javafx.application.Application;
import javafx.beans.property.SimpleStringProperty;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableView;
import javafx.scene.control.cell.PropertyValueFactory;
import javafx.scene.layout.BorderPane;