Skip to content

Instantly share code, notes, and snippets.

Yuichi.Sakuraba skrb

Block or report user

Report or block skrb

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
@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 / 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 / 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 / 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 / RingBuffer.java
Created Dec 20, 2013
Zoetrope: Animation using touch interface
View RingBuffer.java
package net.javainthebox.zoetrope;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
public class RingBuffer<T> {
final private List<T> buffer;
private int index = -1;
@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;
@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 / 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()
You can’t perform that action at this time.