1 26 27 package org.objectweb.util.browser.core.icon; 28 29 import java.awt.Component ; 30 import java.awt.Graphics ; 31 32 39 public class NumberIcon 40 extends javax.swing.plaf.metal.MetalIconFactory.FileIcon16{ 41 42 48 49 protected int number_; 50 51 57 61 public NumberIcon(int number){ 62 number_ = number; 63 } 64 65 71 74 private void myPaint(Component c, Graphics g) { 75 java.awt.Font oldFont = g.getFont(); 76 g.setFont(oldFont.deriveFont(java.awt.Font.BOLD)); 77 g.drawString((new Integer (number_)).toString(),2,12); 78 g.setFont(oldFont); 79 } 81 82 88 public void paintIcon(Component c, Graphics g, int x, int y) { 89 myPaint(c,g); 90 } 91 92 } | Popular Tags |