1 18 19 package org.objectweb.jac.aspects.gui.swing; 20 21 import org.objectweb.jac.aspects.gui.FieldView; 22 import org.objectweb.jac.core.rtti.FieldItem; 23 import java.net.URL ; 24 import javax.swing.ImageIcon ; 25 import javax.swing.JComponent ; 26 import javax.swing.JLabel ; 27 28 32 public class ImageURLViewer extends AbstractFieldView 33 implements FieldView 34 { 35 JLabel label = new JLabel (); 36 37 40 public ImageURLViewer(URL value, Object substance, FieldItem field) { 41 super(substance,field); 42 setValue(value); 43 add(label); 44 } 45 46 public ImageURLViewer() { 47 add(label); 48 } 49 50 55 public void setValue(Object value) { 56 if (value!=null) 57 label.setIcon(new ImageIcon ((URL )value)); 58 else 59 label.setIcon(null); 60 } 61 62 protected JComponent getComponent() { 63 return label; 64 } 65 } 66 | Popular Tags |