import java.awt.image.BufferedImage; import java.awt.image.DataBufferInt; import javafx.application.Application; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.scene.Scene; import javafx.scene.control.Button; import javafx.scene.image.Image; import javafx.scene.image.ImageView; import javafx.scene.layout.VBox; import javafx.scene.paint.Color; import javafx.stage.Stage; import javafx.stage.StageStyle; public class TexelShow extends Application { public static void main(String[] args) { launch(args); } @Override public void start(Stage stage) throws Exception { BufferedImage bi = new BufferedImage(128, 128, BufferedImage.TYPE_INT_ARGB_PRE); DataBufferInt data = (DataBufferInt)bi.getRaster().getDataBuffer(); int [] iData = data.getData(); for (int y=0; y!=128; ++y) { for (int x=0; x!=128; ++x) { int t = (x^y)&1; iData[y*128+x] = t*0x00fFfFFf | 0x00000000; // Transparent // iData[y*128+x] = t*0xFfFfFfFf | 0xFF000000; // Opaque } } ImageView imageView = new ImageView(Image.impl_fromExternalImage(bi)); stage.initStyle(StageStyle.TRANSPARENT); VBox vbox = new VBox(); Button button = new Button(); button.setText("close"); final Stage hackStage = stage; button.setOnAction(new EventHandler() { @Override public void handle(ActionEvent e) { hackStage.close(); } }); vbox.getChildren().add(button); vbox.getChildren().add(imageView); Scene scene = new Scene(vbox, 128, 128); scene.setFill(Color.TRANSPARENT); stage.setScene(scene); stage.show(); } }