Skip to content

Instantly share code, notes, and snippets.

Adrian D Finlay afinlay5

View GitHub Profile
@afinlay5
afinlay5 / FXTestCB.java
Created May 22, 2020
JavaFX 8 -> 11 ComboBox Regression
View FXTestCB.java
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.application.Application;
import javafx.scene.control.*;
import javafx.scene.layout.VBox;
import javafx.scene.input.KeyCode;
import javafx.geometry.Insets;
public class FXTestCB extends Application {
public static void main (String[] args) { launch(args); }
@afinlay5
afinlay5 / ClientBug.java
Created Mar 3, 2020
Bug in Java Client code when calling AWT code from a JavaFX context
View ClientBug.java
import java.io.*;
import java.net.URL;
import java.nio.file.*;
import javafx.application.Application;
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.layout.HBox;
import javafx.scene.control.Button;
View win.gradle snippet
{ properties ->
defineProperty("WINDOWS_VS_VSINSTALLDIR", properties, "C:/Program Files (x86)/Microsoft Visual Studio/2017/Community");
defineProperty("WINDOWS_VS_WINSDKDLLINSTALLDIR", properties, "C:/Program Files (x86)/Windows Kits/10/Redist/10.0.17763.0/ucrt/DLLs");
defineProperty("WINDOWS_SDK_DIR", properties, System.getenv().get("WINSDK_DIR"))
defineProperty("WINDOWS_SDK_VERSION", properties, "")
defineProperty("WINDOWS_VS_VCINSTALLDIR", properties, "$WINDOWS_VS_VSINSTALLDIR/VC")
defineProperty("WINDOWS_VS_DEVENVDIR", properties, "$WINDOWS_VS_VSINSTALLDIR/Common7/IDE")
defineProperty("WINDOWS_VS_DEVENVCMD", properties, "$WINDOWS_VS_DEVENVDIR/devenv.exe")
defineProperty("WINDOWS_VS_MSVCDIR", properties, WINDOWS_VS_VCINSTALLDIR)
defineProperty("WINDOWS_DXSDK_DIR", properties, System.getenv().get("DXSDK_DIR"))
View VarAnonInner.java
public class VarAnonInner {
public static void main (String[] args) throws Exception {
var anonInner = new Anon() {
public void hello() {
System.out.println("New method here, and you can easily access me in Java 10!\n" +
"The class is: " + this.getClass()
);
};
};
anonInner.hello();
View RESTDemo.java
/*
Copyright (C) 2018 Adrian D. Finlay. All rights reserved.
Licensed under the MIT License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://opensource.org/licenses/MIT
Permission is hereby granted, free of charge, to any person obtaining a copy
View RESTDemo11.java
/*
Copyright (C) 2018 Adrian D. Finlay. All rights reserved.
Licensed under the MIT License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://opensource.org/licenses/MIT
Permission is hereby granted, free of charge, to any person obtaining a copy
View HTTPDemo.java
import java.io.File;
import java.net.URI;
import java.util.Scanner;
import java.time.Duration;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.Files;
import java.io.InputStream;
import java.io.FileOutputStream​;
import java.net.Authenticator;
View javafxports Windows Shell
:: This Script automates the creating of our project directories.
@ECHO OFF
ECHO "Creating platform independent directories...."
MD src/main/java
MD src/main/resources
ECHO "Creating directories for Android...."
MD src/android/java
MD src/android/resources
View javafxports Bash Script
#!/bin/bash
echo "Creating platform independent directories...."
mkdir -p src/main/java
mkdir -p src/main/resources
echo "Creating directories for Android...."
mkdir -p src/android/java
mkdir -p src/android/resources
mkdir -p src/android/assets
View build.gradle
/*
OnyxFxMobile: A simple, cross-platform NBA stat app for Andriod, iOS written in Java/JavaFX.
Author: Adrian D. Finlay
License: GPLv2
*/
buildscript {
repositories {
jcenter()
}
You can’t perform that action at this time.