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 StringIcon 40 extends javax.swing.plaf.metal.MetalIconFactory.FileIcon16 41 { 42 43 49 50 protected String value_; 51 52 58 62 public StringIcon(String value){ 63 value_ = value; 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(value_,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 |