Skip to content

Instantly share code, notes, and snippets.

View TW2's full-sized avatar

RedDog,csa TW2

View GitHub Profile
@TW2
TW2 / Webimg.java
Created April 19, 2024 19:20
JavaFX custom tag permits to integrate image in the webpage
package org.wingate.webimg;
import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.io.File;
import java.util.Arrays;
import java.util.List;
import javafx.application.Platform;
import javafx.embed.swing.JFXPanel;
import javafx.scene.Group;
@TW2
TW2 / IDemoModel.java
Last active April 28, 2020 04:41
A plugin system with maven and Java 14
package org.wingate.demomodel;
public interface IDemoModel {
public String getName();
}
@TW2
TW2 / Gif.java
Created July 23, 2018 06:40
A GIF on a JPanel that works with small images. (We would prefer using JLabel for GIF!)
package gifinpaneldemo;
import java.awt.image.BufferedImage;
/**
*
* @author util2
*/
public class Gif {
@TW2
TW2 / DrawColor.java
Created October 12, 2017 18:36
One color, two colors, few colors, and many many more... A snippet to extend Color collection in Java SE.
import java.awt.Color;
public enum DrawColor {
//Colors from http://www.rapidtables.com/web/color/RGB_Color.htm
maroon("800000",128,0,0),
dark_red("8B0000",139,0,0),
brown("A52A2A",165,42,42),
firebrick("B22222",178,34,34),
crimson("DC143C",220,20,60),