Skip to content

Instantly share code, notes, and snippets.

@skrb
skrb / Main.java
Last active Sep 26, 2019
Swing Image View Demo
View Main.java
package net.javainthebox.imageview;
import java.awt.BorderLayout;
import java.awt.Dimension;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;
@skrb
skrb / Main.java
Created Sep 26, 2019
JavaFX Image View Demo
View Main.java
package net.javainthebox.imageview;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.BorderPane;
import javafx.stage.Stage;
public class Main extends Application {
@skrb
skrb / AnimationDemo.java
Created Jun 6, 2019
AnimationTimerのサンプル
View AnimationDemo.java
import java.util.List;
import java.util.Random;
import java.util.stream.Collectors;
import javafx.animation.AnimationTimer;
import javafx.application.Application;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.layout.Pane;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
@skrb
skrb / AnimationDemo.java
Created Jun 6, 2019
AnimationTimerのサンプル
View AnimationDemo.java
import java.util.List;
import java.util.Random;
import java.util.stream.Collectors;
import javafx.animation.AnimationTimer;
import javafx.application.Application;
import javafx.scene.Node;
import javafx.scene.Scene;
import javafx.scene.layout.Pane;
import javafx.scene.paint.Color;
@skrb
skrb / HttpResponseUtils.java
Created Aug 19, 2017
HTTP/2 Client Sample
View HttpResponseUtils.java
public class HttpResponseUtils {
public static HttpResponse.BodyHandler<Path> createHandler(Path path) {
return (status, headers) -> {
return headers.firstValue("Content-Disposition")
.map(header -> {
if (header.startsWith("attachment;")) {
return Arrays.stream(header.split(";"))
.map(item -> item.trim())
.filter(item -> item.startsWith("filename="))
.findFirst()
@skrb
skrb / MarsBumpMappingDemo.java
Created Dec 25, 2016
JavaFX Bump Mapping Demo
View MarsBumpMappingDemo.java
import javafx.animation.Animation;
import javafx.animation.Interpolator;
import javafx.animation.RotateTransition;
import javafx.application.Application;
import javafx.geometry.Point3D;
import javafx.scene.Group;
import javafx.scene.PerspectiveCamera;
import javafx.scene.Scene;
import javafx.scene.image.Image;
View LensEffect.java
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.effect.DisplacementMap;
import javafx.scene.effect.Effect;
import javafx.scene.effect.FloatMap;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.StackPane;
import javafx.scene.paint.Color;
View TextCrawler3.java
import javafx.animation.Animation;
import javafx.animation.Interpolator;
import javafx.animation.KeyFrame;
import javafx.animation.KeyValue;
import javafx.animation.ParallelTransition;
import javafx.animation.PauseTransition;
import javafx.animation.SequentialTransition;
import javafx.animation.Timeline;
import javafx.animation.TranslateTransition;
View TextCrawler2.java
import javafx.animation.Animation;
import javafx.animation.Interpolator;
import javafx.animation.ParallelTransition;
import javafx.animation.PauseTransition;
import javafx.animation.RotateTransition;
import javafx.animation.ScaleTransition;
import javafx.animation.SequentialTransition;
import javafx.animation.TranslateTransition;
import javafx.application.Application;
@skrb
skrb / TextCrawler.java
Last active Dec 17, 2015
Crawler Demo 1
View TextCrawler.java
import javafx.animation.Animation;
import javafx.animation.Interpolator;
import javafx.animation.PauseTransition;
import javafx.animation.SequentialTransition;
import javafx.animation.TranslateTransition;
import javafx.application.Application;
import static javafx.application.Application.launch;
import javafx.geometry.Point3D;
import javafx.scene.Group;
You can’t perform that action at this time.