Skip to content

Instantly share code, notes, and snippets.

View bugabinga's full-sized avatar
♨️
Working hard.

Oliver Jan Krylow bugabinga

♨️
Working hard.
View GitHub Profile
@bugabinga
bugabinga / WebEngineLoadBug.java
Created March 8, 2016 08:34 — forked from anonymous/WebEngineLoadBug.java
Attempt to reproduce a WebEngine loading bug in JavaFX (failed)
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import javafx.stage.Stage;
import netscape.javascript.JSObject;
/**
* https://stackoverflow.com/questions/35758313/consistent-setmember-on-javafx-window
*
@bugabinga
bugabinga / MappingList.java
Created March 3, 2016 14:43
Example of an ObservableListWrapper for JavaFx that maps values from a source list to a mapped list according to a user defined transformation. It is the analog of Stream.map for ObservableList.
package net.bugabinga.javafx.util;
import static java.util.stream.Collectors.toList;
import java.util.List;
import java.util.function.Function;
import javafx.collections.ListChangeListener.Change;
import javafx.collections.ObservableList;
import javafx.collections.ObservableListBase;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.DatePicker;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
/**
* How to show the UI of a DatePicker constantly.
*
package com.isp.stackoverflow;
import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.geometry.VPos;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.Background;
import javafx.scene.layout.BackgroundFill;
package com.isp.stackoverflow;
import javafx.application.Application;
import javafx.beans.binding.DoubleBinding;
import javafx.scene.Scene;
import javafx.scene.image.ImageView;
import javafx.scene.layout.ColumnConstraints;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.Pane;
import javafx.scene.layout.RowConstraints;
@bugabinga
bugabinga / FlowSpacer.java
Created January 19, 2016 09:10
Example of forcing alignment in a FlowPane.
package com.isp.stackoverflow;
import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.layout.FlowPane;
import javafx.stage.Stage;
@bugabinga
bugabinga / Extractor.java
Created January 19, 2016 08:31
Example of TreeViewRow style binding
package com.isp.stackoverflow;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import javafx.application.Application;
import javafx.beans.Observable;
import javafx.beans.binding.Bindings;
import javafx.beans.property.IntegerProperty;
import javafx.beans.property.SimpleIntegerProperty;
@bugabinga
bugabinga / InverseClip.java
Created December 2, 2015 23:08
Demonstrates an inverse clipping technique in JavaFx.
package application;
import javafx.application.Application;
import javafx.beans.binding.Bindings;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.control.ProgressBar;
import javafx.scene.effect.InnerShadow;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
@bugabinga
bugabinga / JfxTestRunner.java
Created November 18, 2015 10:45
This runner can be used to run JUnit-Tests on the JavaFx-Thread.
/**
* © 2015 isp-insoft all rights reserved.
*/
package com.isp.lpt;
import java.util.concurrent.CountDownLatch;
import org.junit.runner.RunWith;
import org.junit.runners.BlockJUnit4ClassRunner;
import org.junit.runners.model.InitializationError;
import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.ToolBar;
import javafx.scene.layout.HBox;
import javafx.scene.layout.Priority;
import javafx.stage.Stage;