Skip to content

Instantly share code, notes, and snippets.

@aoetk
aoetk / GridPaneSample.fxml
Created December 6, 2017 06:02
GridPaneのサンプル
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.*?>
<?import javafx.scene.control.*?>
<?import java.lang.*?>
<?import javafx.scene.layout.*?>
<GridPane hgap="10.0" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" vgap="10.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/8.0.40">
<columnConstraints>
<ColumnConstraints hgrow="NEVER" minWidth="10.0" />
@aoetk
aoetk / JavaBeansSampleApp.java
Created April 26, 2017 13:20
getter/setter以外のメソッドをJavaBeansのプロパティアクセッサに使う例
package aoetk.sample;
import java.beans.BeanInfo;
import java.beans.IntrospectionException;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
import java.lang.reflect.InvocationTargetException;
/**
* Beanの利用例.
@aoetk
aoetk / DesktopAPITestApp.java
Last active October 13, 2021 23:30
Java 9のデスクトップAPIをJavaFXから利用するサンプル
package aoetk.test.desktop;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
public class DesktopAPITestApp extends Application {
@aoetk
aoetk / CheckDigitApp.java
Created February 21, 2016 10:50
チェックディジット (Modulus10 / Weight3) のサンプル
package aoetk;
public class CheckDigitApp {
public static void main(String[] args) {
if (args.length != 1) {
System.out.println("Usage: java aoetk.CheckDigitApp target");
System.exit(1);
}
try {
package sample;
import javafx.beans.binding.IntegerBinding;
import javafx.beans.property.IntegerProperty;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.control.Label;
import javafx.scene.control.Spinner;
import javafx.scene.control.SpinnerValueFactory;
@aoetk
aoetk / Controller.java
Last active August 29, 2015 14:21
JavaFXで2つのListViewのスクロールを同期させるサンプル
package sample;
import java.util.Set;
import javafx.application.Platform;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.geometry.Orientation;
@aoetk
aoetk / FirebugSampleApp.java
Created April 16, 2015 09:54
ローカルのWebサーバに置いたFirebug LiteをJavaFXのWebViewで使うサンプル
package sample;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
public class FirebugSampleApp extends Application {
@aoetk
aoetk / UnifiedSampleApp.java
Created April 8, 2015 15:02
Unified Styleのサンプル
package sample;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.control.Label;
import javafx.scene.layout.StackPane;
import javafx.scene.paint.Color;
import javafx.stage.Stage;
import javafx.stage.StageStyle;
@aoetk
aoetk / ShapeSample.css
Last active August 29, 2015 14:02
JavaFXでSVGアイコンを使ったボタンのサンプル
.button-icon-shape {
-fx-scale-x: 2.0;
-fx-scale-y: 2.0;
}
.stop-button-icon {
-fx-fill: black;
}
.circle-button {
@aoetk
aoetk / StringJoinBench.java
Last active August 29, 2015 13:58
文字列連結のブログエントリのコードhttp://d.hatena.ne.jp/aoe-tk/20140409/1397059399
package aoetk.stringjoin;
import java.nio.ByteBuffer;
import java.nio.CharBuffer;
import java.util.Arrays;
import java.util.List;
import java.util.StringJoiner;
import java.util.function.Supplier;
import java.util.stream.Collectors;
import java.util.stream.IntStream;