Skip to content

Instantly share code, notes, and snippets.

@skrb
skrb / Eyes.java
Created December 27, 2011 10:49
FXEyes
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 April 8, 2012 02:04
JavaFX WebView Sample
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 12:03
Lambda equation sample with JavaFX
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 June 12, 2012 12:38
JavaFX Animation Sample
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;
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 July 5, 2012 11:02
JavaFX Simple FXML-Controler Sample
<?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 July 24, 2012 13:08
JJUG Project Lambda Hands-on Materials
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 July 27, 2012 11:58
JJUG Project Lambda Hands-on Materials - Sample Answers
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 September 6, 2012 09:45
Reverse Polish Notation sample
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 December 19, 2012 07:46
Example of JavaFX binding.
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;