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