1 19 package org.netbeans.swing.tabcontrol.plaf; 20 import javax.swing.*; 21 import java.awt.event.*; 22 import java.awt.*; 23 24 25 26 public class ChicletDemo { 27 public static void main (String [] ignored) { 28 new TestFrame().setVisible(true); 29 } 30 31 32 private static class TestFrame extends JFrame implements WindowListener { 33 private GenericGlowingChiclet thing = new GenericGlowingChiclet(); 34 35 public TestFrame() { 36 addWindowListener(this); 37 setBounds(20, 20, 200, 80); 38 } 39 40 41 public void paint(Graphics g) { 42 super.paint(g); 43 ColorUtil.setupAntialiasing(g); 44 thing.setArcs(0.5f, 0.5f, 0.5f, 0.5f); 46 thing.setNotch(true, false); 47 Color[] rollover = new Color[]{ 48 new Color(222, 222, 227), new Color(220, 238, 255), new Color(190, 247, 255), 49 new Color(205, 205, 205)}; 50 51 thing.setColors(rollover[0], rollover[1], rollover[2], rollover[3]); 53 thing.setAllowVertical(true); 54 thing.setBounds(25, 25, getWidth() - 120, getHeight() - 40); 55 thing.draw((Graphics2D) g); 56 } 57 58 public void windowActivated(WindowEvent e) { 59 } 60 61 public void windowClosed(WindowEvent e) { 62 } 63 64 public void windowClosing(WindowEvent e) { 65 System.exit(0); 66 } 67 68 public void windowDeactivated(WindowEvent e) { 69 } 70 71 public void windowDeiconified(WindowEvent e) { 72 } 73 74 public void windowIconified(WindowEvent e) { 75 } 76 77 public void windowOpened(WindowEvent e) { 78 } 79 }} | Popular Tags |