Skip to content

Instantly share code, notes, and snippets.

james-d

Block or report user

Report or block james-d

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View HighlightingLabelLayout.java
import java.util.stream.Collectors;
import javafx.beans.property.StringProperty;
import javafx.beans.property.StringPropertyBase;
import javafx.css.PseudoClass;
import javafx.scene.Node;
import javafx.scene.control.Label;
import javafx.scene.layout.Pane;
public class HighlightingLabelLayout extends Pane {
View KeepTrackOfTableCells.java
import java.util.HashMap;
import java.util.Map;
import java.util.Random;
import java.util.function.Function;
import javafx.animation.KeyFrame;
import javafx.animation.KeyValue;
import javafx.animation.Timeline;
import javafx.application.Application;
View Game.java
package tankgame;
import java.util.ArrayList;
import java.util.List;
import javafx.animation.AnimationTimer;
import javafx.application.Application;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.geometry.Insets;
@james-d
james-d / FXCamTest.java
Last active May 18, 2018
JavaFX wrapper classes for sarxos webcam Java library. Wraps a web cam as a JavaFX Service and provides a View class for the service.
View FXCamTest.java
import com.github.sarxos.webcam.Webcam;
import javafx.application.Application;
import javafx.beans.binding.Bindings;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.layout.BorderPane;
View FadeExample.java
import javafx.animation.Animation;
import javafx.animation.FadeTransition;
import javafx.animation.ParallelTransition;
import javafx.animation.SequentialTransition;
import javafx.application.Application;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.geometry.HPos;
import javafx.scene.Node;
View Arrival.fxml
<!-- in arrival package -->
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.layout.BorderPane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.DatePicker?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.control.Button?>
@james-d
james-d / PanningTiledPane.java
Last active Jul 16, 2018
Example of (essentially) infinite panning in JavaFX using a fixed set of ImageViews and updating their images on panning. Prototype for Google Maps type of interface.
View PanningTiledPane.java
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import javafx.beans.property.DoubleProperty;
import javafx.beans.property.DoublePropertyBase;
import javafx.beans.property.ReadOnlyIntegerWrapper;
import javafx.geometry.Pos;
@james-d
james-d / SunEarthMoon.java
Last active May 18, 2018
Very simple (and not intended to be accurate) model of the sun, earth and moon to demonstrate rotations applied to circles in JavaFX.
View SunEarthMoon.java
import javafx.animation.Animation;
import javafx.animation.KeyFrame;
import javafx.animation.KeyValue;
import javafx.animation.Timeline;
import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.layout.Pane;
import javafx.scene.paint.Color;
@james-d
james-d / UndoRectangle.java
Last active May 25, 2016
Experiment with UndoFX and dragging to move/resize a rectangle. Requires [UndoFX](https://github.com/TomasMikula/UndoFX/)
View UndoRectangle.java
import java.util.Objects;
import java.util.Optional;
import java.util.function.Consumer;
import java.util.function.Function;
import org.fxmisc.undo.UndoManager;
import org.fxmisc.undo.UndoManagerFactory;
import org.reactfx.EventStream;
import org.reactfx.EventStreams;
View CyrillicAndLatin.java
import javafx.application.Application;
import javafx.geometry.Insets;
import javafx.geometry.Pos;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.GridPane;
import javafx.stage.Stage;
public class CyrillicAndLatin extends Application {
You can’t perform that action at this time.