1 26 package org.objectweb.util.explorer.swing.icon; 27 28 import java.awt.Component ; 29 import java.awt.Graphics ; 30 31 39 public class NumberIcon 40 extends javax.swing.plaf.metal.MetalIconFactory.FileIcon16 41 { 42 43 49 50 protected int number_; 51 52 58 62 public NumberIcon(int number){ 63 number_ = number; 64 } 65 66 72 75 private void myPaint(Component c, Graphics g) { 76 java.awt.Font oldFont = g.getFont(); 77 g.setFont(oldFont.deriveFont(java.awt.Font.BOLD)); 78 g.drawString((new Integer (number_)).toString(),2,12); 79 g.setFont(oldFont); 80 } 82 83 89 public void paintIcon(Component c, Graphics g, int x, int y) { 90 myPaint(c,g); 91 } 92 93 } 94 95 96 | Popular Tags |