Skip to content

Instantly share code, notes, and snippets.

View Eyes.java
package net.javainthebox.fxeyes;
import javafx.beans.binding.DoubleBinding;
import javafx.beans.property.DoubleProperty;
import javafx.beans.property.SimpleDoubleProperty;
import javafx.geometry.Point2D;
import javafx.scene.Parent;
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;
import javafx.scene.shape.Ellipse;
@skrb
skrb / Test.java
Created Apr 8, 2012
JavaFX WebView Sample
View Test.java
import java.io.IOException;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.StackPane;
import javafx.scene.web.WebEngine;
import javafx.scene.web.WebView;
import javafx.stage.Stage;
public class Test extends Application {
@skrb
skrb / LambdaTest.java
Created May 23, 2012
Lambda equation sample with JavaFX
View LambdaTest.java
import java.util.Map;
import java.util.LinkedHashMap;
import static java.lang.Math.*;
import javafx.animation.KeyFrame;
import javafx.animation.Timeline;
import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
@skrb
skrb / ComplexAnimation.java
Created Jun 12, 2012
JavaFX Animation Sample
View ComplexAnimation.java
package net.javainthebox.jfx.animation;
import javafx.animation.FadeTransition;
import javafx.animation.KeyFrame;
import javafx.animation.KeyValue;
import javafx.animation.ScaleTransition;
import javafx.animation.Timeline;
import javafx.animation.TranslateTransition;
import javafx.application.Application;
import javafx.event.ActionEvent;
View SimpleImagePresenter.java
package net.javainthebox.jfx.simplepresenter;
import java.io.IOException;
import javafx.animation.TranslateTransition;
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.scene.Group;
import javafx.scene.Node;
import javafx.scene.Scene;
@skrb
skrb / Form.xml
Created Jul 5, 2012
JavaFX Simple FXML-Controler Sample
View Form.xml
<?xml version="1.0" encoding="UTF-8"?>
<?import java.lang.*?>
<?import java.net.*?>
<?import java.util.*?>
<?import javafx.scene.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>
<AnchorPane id="AnchorPane" prefHeight="100.0" prefWidth="320.0" xmlns:fx="http://javafx.com/fxml" fx:controller="FormController">
@skrb
skrb / FizzBuzz.java
Created Jul 24, 2012
JJUG Project Lambda Hands-on Materials
View FizzBuzz.java
import java.util.ArrayList;
import java.util.List;
public class FizzBuzz {
private static final String FIZZBUZZ = "FizzBuzz";
private static final String FIZZ = "Fizz";
private static final String BUZZ = "Buzz";
public FizzBuzz() {
List<Integer> numbers = initNumbers();
@skrb
skrb / FizzBuzzWLambda.java
Created Jul 27, 2012
JJUG Project Lambda Hands-on Materials - Sample Answers
View FizzBuzzWLambda.java
import java.util.ArrayList;
import java.util.List;
public class FizzBuzzWLambda {
private static final String FIZZBUZZ = "FizzBuzz";
private static final String FIZZ = "Fizz";
private static final String BUZZ = "Buzz";
public FizzBuzzWLambda() {
List<Integer> numbers = initNumbers();
@skrb
skrb / Calculator.java
Created Sep 6, 2012
Reverse Polish Notation sample
View Calculator.java
import java.util.ArrayDeque;
import java.util.HashMap;
import java.util.Map;
class Stack extends ArrayDeque<Double> {
@Override
public void push(Double v) {
System.out.println(toString() + "<-" + v);
super.push(v);
}
@skrb
skrb / ConnectedBall.java
Created Dec 19, 2012
Example of JavaFX binding.
View ConnectedBall.java
import javafx.application.Application;
import javafx.event.EventHandler;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.input.MouseEvent;
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;
import javafx.scene.shape.Line;
import javafx.stage.Stage;