Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@TurekBot
TurekBot / TextAreaTableCell.java
Last active November 23, 2020 16:59 — forked from eckig/TextAreaTableCell.java
An attempt to improve the already great TextAreaTableCell, see Stack Overflow question: http://stackoverflow.com/questions/27666382/editable-multiline-cell-in-tableview
import javafx.beans.binding.Bindings;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.scene.control.Cell;
import javafx.scene.control.TableCell;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TextArea;
import javafx.scene.input.KeyCode;
import javafx.util.Callback;
import javafx.util.StringConverter;
@TurekBot
TurekBot / gist:9bdbcc0eee80bc48749ab1f795308b92
Created October 25, 2017 18:08
Attempt 1 at Installing gv4j
PS C:\Users\BTUREK\IdeaProjects> git clone --depth=50 --branch=master git://github.com/twyatt/gv4j.git twyatt/gv4j
Cloning into 'twyatt/gv4j'...
remote: Counting objects: 143, done.
Receiving tal 143 (delta 0), reused 0 (delta 0), pack-reused 143R
Receiving objects: 100% (143/143), 64.99 KiB | 801.00 KiB/s, done.
Resolving deltas: 100% (32/32), done.
PS C:\Users\BTUREK\IdeaProjects> ls
Directory: C:\Users\BTUREK\IdeaProjects
@TurekBot
TurekBot / gist:721aaee63ca3656690b7ecb7a9de198f
Created November 18, 2017 00:02
CheckComboBoxTableCell Exception
Exception in thread "JavaFX Application Thread" java.lang.NullPointerException
at com.sun.javafx.scene.control.skin.ComboBoxPopupControl.positionAndShowPopup(ComboBoxPopupControl.java:197)
at com.sun.javafx.scene.control.skin.ComboBoxPopupControl.show(ComboBoxPopupControl.java:170)
at com.sun.javafx.scene.control.skin.ComboBoxBaseSkin.handleControlPropertyChanged(ComboBoxBaseSkin.java:127)
at com.sun.javafx.scene.control.skin.ComboBoxListViewSkin.handleControlPropertyChanged(ComboBoxListViewSkin.java:159)
at com.sun.javafx.scene.control.skin.BehaviorSkinBase.lambda$registerChangeListener$61(BehaviorSkinBase.java:197)
at com.sun.javafx.scene.control.MultiplePropertyChangeListenerHandler$1.changed(MultiplePropertyChangeListenerHandler.java:55)
at javafx.beans.value.WeakChangeListener.changed(WeakChangeListener.java:89)
at com.sun.javafx.binding.ExpressionHelper$SingleChange.fireValueChangedEvent(ExpressionHelper.java:182)
at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper
@TurekBot
TurekBot / NPE.java
Created December 1, 2017 00:15
The exception thrown when attempting to remove the toolbars from an HTMLEditor.
java.lang.NullPointerException
at com.sun.webkit.WebPage.paint(WebPage.java:692)
at com.sun.javafx.sg.prism.web.NGWebView.renderContent(NGWebView.java:96)
at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2053)
at com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1945)
at com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:235)
at com.sun.javafx.sg.prism.NGRegion.renderContent(NGRegion.java:576)
at com.sun.javafx.sg.prism.NGNode.doRender(NGNode.java:2053)
at com.sun.javafx.sg.prism.NGNode.render(NGNode.java:1945)
at com.sun.javafx.sg.prism.NGGroup.renderContent(NGGroup.java:235)
@TurekBot
TurekBot / build.gradle
Created January 10, 2018 17:46
Gradle Shadow Example
group 'com.github.yourusername'
version '1.0-SNAPSHOT'
//These are dependencies that have to do with just the build. See: https://stackoverflow.com/a/23627293/5432315
buildscript {
repositories {
jcenter()
}
dependencies {
//This is necessary to use the gradle shadow plugin
@TurekBot
TurekBot / gist:51187a9bdfde85374cf6f8b2ebccf57e
Created February 5, 2018 21:47
PopupDemo's `VirtualizedScrollPane<InlineCssTextArea> vsPane = new VirtualizedScrollPane<>(area);` throws this exception when you try to type in the text area.
Exception in thread "JavaFX Application Thread" java.lang.IllegalStateException
at org.reactfx.util.AccumulationFacility$IllegalAccumulation.reduce(AccumulationFacility.java:16)
at org.reactfx.util.HashAccuMap.addAll(AccuMap.java:168)
at org.reactfx.util.IteratorBasedAccuMap.addAll(AccuMap.java:127)
at org.reactfx.util.NotificationAccumulatorBase.addAll(NotificationAccumulator.java:107)
at org.reactfx.ObservableBase.enqueueNotifications(ObservableBase.java:62)
at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:56)
at org.reactfx.SuspendableBase.handleEvent(SuspendableBase.java:82)
at org.reactfx.util.NonAccumulativeStreamNotifications.lambda$head$0(NotificationAccumulator.java:134)
at org.reactfx.ObservableBase.notifyObservers(ObservableBase.java:68)
@TurekBot
TurekBot / Investigator.java
Created March 8, 2018 19:33 — forked from james-d/Investigator.java
Example of JPA entities that use JavaFX properties. These use a "super-lazy" idiom for instantiating the properties, and implement Externalizable to work around the lack of Serialization support in the FX property classes.
package edu.marshall.genomics.lims.entities;
import java.io.Externalizable;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import javafx.beans.property.IntegerProperty;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleStringProperty;
@TurekBot
TurekBot / javapackager template.iss
Last active February 21, 2023 11:50
The Inno Setup template that the javapackager uses to create installers. If you use this template as a drop-in resource, the javapackager will still replace the variables for you. Found in the jar %JAVA_HOME%\lib\ant-javafx.jar under the com\oracle\tools\packager\windows\template.iss file.
;This file will be executed next to the application bundle image
;I.e. current directory will contain folder APPLICATION_NAME with application files
[Setup]
AppId={{PRODUCT_APP_IDENTIFIER}}
AppName=APPLICATION_NAME
AppVersion=APPLICATION_VERSION
AppVerName=APPLICATION_NAME APPLICATION_VERSION
AppPublisher=APPLICATION_VENDOR
AppComments=APPLICATION_COMMENTS
AppCopyright=APPLICATION_COPYRIGHT
@TurekBot
TurekBot / ClipBoardFXAwtComparison.java
Last active April 14, 2019 19:07
A program to test out the differences between the AWT Java Clipboard and the JavaFX Clipboard.
package sample;
import com.sun.glass.ui.ClipboardAssistance;
import javafx.application.Application;
import javafx.embed.swing.SwingFXUtils;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Alert;
import javafx.scene.control.Button;
import javafx.application.Platform;
import javafx.beans.value.ChangeListener;
import javafx.collections.ListChangeListener;
import javafx.concurrent.Worker.State;
import javafx.geometry.HPos;
import javafx.geometry.VPos;
import javafx.scene.Node;
import javafx.scene.layout.Region;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;