Skip to content

Instantly share code, notes, and snippets.

@tomsontom
tomsontom / dialog.html
Last active April 3, 2024 10:55
Scrollbars inside Dialogs remove focus
<html>
<head>
<title>Overflow Page vs Overflow Dialog</title>
<style>
.scroll-container {
max-height: 200px;
max-width: 200px;
min-width: 200px;
padding: 10px;
background-color: red;
@tomsontom
tomsontom / MySwitch.java
Last active October 19, 2022 21:41
Java-19 Switch / Source Compat Problem
package blo;
public class MySwitch {
public interface NamedItem {
public String name();
}
public static class MyTypeA /* implements NamedItem*/ {
private final String value;
@tomsontom
tomsontom / Base.java
Last active July 20, 2022 09:08
Java Visibility Puzzler
package sampler;
public class Base {
void packageMethod() {
System.err.println("Package on " + getClass());
}
protected void protectedMethod() {
System.err.println("Protected on " + getClass());
}
@tomsontom
tomsontom / SkiaFX.java
Created November 26, 2020 10:40
Hardware Accelerate SkiaCanvas in JavaFX
package at.bestsolution.skia.example;
import org.jetbrains.skija.Paint;
import org.jetbrains.skija.Path;
import org.jetbrains.skija.Point;
import org.jetbrains.skija.Surface;
import at.bestsolution.skia.SkiaCanvas;
import javafx.application.Application;
import javafx.scene.Scene;
package bla;
import java.lang.module.Configuration;
import java.lang.module.ModuleFinder;
import java.nio.file.Path;
import java.util.Set;
public class SampleLayer {
public static void main(String[] args) throws ClassNotFoundException {
Path[] paths = { Path.of("/Users/tomschindl/SDKs/javafx-sdk-11.0.2/lib/javafx.base.jar") };
@tomsontom
tomsontom / ListBox.stories.tsx
Created August 5, 2020 22:21
ListBox.stories.tsx
/*
* Copyright 2020 Adobe. All rights reserved.
* This file is licensed to you under the Apache 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 http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
* OF ANY KIND, either express or implied. See the License for the specific language
* governing permissions and limitations under the License.
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/demo" xmlns:tns="http://www.example.org/demo" elementFormDefault="qualified">
<complexType name="abstract-element" abstract="true">
<attribute name="attribute" type="string" />
</complexType>
<complexType name="other-element">
<attribute name="attribute" type="string" />
</complexType>
<complexType name="derived-element">
<complexContent>
@tomsontom
tomsontom / SimpleLayerCreation.java
Created October 24, 2018 07:54
Simple creation of new Java-Module-System-Layer
package javamodules;
import java.lang.module.Configuration;
import java.lang.module.ModuleFinder;
import java.net.URL;
import java.net.URLClassLoader;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Set;
@tomsontom
tomsontom / FeatureRichLayerCreation.java
Last active November 15, 2018 14:04
Add exports for dynamic layers
/*
* For modules on the boot-layer one can add exports using --add-exports but it looks like there's no
* public API to do the same when constructing a custom layer
*/
package javamodules;
import java.lang.ModuleLayer.Controller;
import java.lang.module.Configuration;
import java.lang.module.ModuleFinder;
import java.net.URL;
@tomsontom
tomsontom / MANIFEST.MF
Last active February 21, 2017 12:45
Generated MANIFEST.MF
Manifest-Version: 1.0
Bnd-LastModified: 1487674769039
Bundle-ManifestVersion: 2
Bundle-Name: org.eclipse.fx.core
Bundle-SymbolicName: org.eclipse.fx.core
Bundle-Version: 3.0.0.201702211059
Created-By: 1.8.0_121 (Oracle Corporation)
Export-Package: org.eclipse.fx.core;version="3.0.0",
org.eclipse.fx.core.adapter;version="3.0.0",
org.eclipse.fx.core.app;version="3.0.0",