Skip to content

Instantly share code, notes, and snippets.

View aterai's full-sized avatar

TERAI Atsuhiro aterai

View GitHub Profile
import java.awt.*;
import java.awt.event.*;
import java.awt.geom.*;
import java.awt.image.*;
import java.util.*;
import javax.swing.*;
import javax.swing.border.*;
public class RoundedBorderTest {
public JComponent makeUI() {
import java.awt.*;
import java.util.Objects;
import javax.swing.*;
import javax.swing.border.*;
import javax.swing.table.*;
public class TransparentHeaderTest {
public JComponent makeUI() {
Color alphaZero = new Color(0x0, true);
//package example;
//-*- mode:java; encoding:utf-8 -*-
// vim:set fileencoding=utf-8:
//@homepage@
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.*;
import javax.swing.Timer;
import javax.swing.tree.*;
import java.awt.*;
import java.awt.image.ImageObserver;
import java.util.Objects;
import javax.swing.*;
import javax.swing.tree.*;
public class AnimatedTreeNodeTest {
public JComponent makeUI() {
ImageIcon icon = new ImageIcon(getClass().getResource(
"restore_to_background_color.gif"));
//package example;
//-*- mode:java; encoding:utf-8 -*-
// vim:set fileencoding=utf-8:
//http://java-swing-tips.blogspot.jp/2012/02/jcheckbox-node-jtree.html
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.tree.*;
//package example;
//-*- mode:java; encoding:utf-8 -*-
// vim:set fileencoding=utf-8:
//@homepage@
import java.awt.*;
import java.awt.event.*;
import java.beans.*;
import java.io.*;
import java.util.List;
import javax.swing.*;
import java.awt.*;
import java.awt.geom.*;
import javax.swing.*;
public class BevelRoundedCornerButtonTest {
public JComponent makeUI() {
JPanel p = new JPanel();
p.add(new JButton("Default JButton"));
p.add(new BevelRoundedCornerButton("Rounded Corner Button"));
return p;
@aterai
aterai / DurationFormatTest.java
Last active August 29, 2015 14:23
Duration format test
import java.time.*;
import java.time.temporal.*;
public class DurationFormatTest {
public static void main(String... args) throws Exception {
for (int i = 0; i < 10; i++) {
long startTime = System.nanoTime();
Thread.sleep(1000, 888888);
long endTime = System.nanoTime();
@aterai
aterai / MainPanel.java
Last active August 29, 2015 14:07
「漢字の線に囲まれた部分だけを塗りつぶした画像で何の四字熟語か当てるスレ:キニ速」をみて作ってみた。
//package example;
//-*- mode:java; encoding:utf-8 -*-
// vim:set fileencoding=utf-8:
// http://ateraimemo.com/Swing/FontSilhouette.html
// http://stackoverflow.com/questions/18686199/fill-unicode-characters-in-labels
// http://blog.livedoor.jp/kinisoku/archives/4204798.html
import java.awt.*;
import java.awt.font.*;
import java.awt.geom.*;
import java.io.Serializable;
@aterai
aterai / p2m.rb
Last active April 30, 2017 12:40
PukiWiki 2 Markdown forked from: http://magazine.rubyist.net/?0010-CodeReview
# -*- mode: ruby; encoding: utf-8 -*-
require 'uri'
require 'date'
require 'yaml'
module HTMLUtils
ESC = {
'&' => '&amp;',
'"' => '&quot;',
'<' => '&lt;',