1 18 19 package org.objectweb.jac.aspects.gui.swing; 20 21 22 import org.objectweb.jac.aspects.gui.FieldView; 23 import org.objectweb.jac.aspects.gui.GuiAC; 24 import org.objectweb.jac.core.rtti.FieldItem; 25 import javax.swing.JComponent ; 26 import javax.swing.JLabel ; 27 28 32 33 public class CurrencyViewer extends AbstractFieldView 34 implements FieldView 35 { 36 String currency; 37 JLabel label; 38 39 public CurrencyViewer(Object value, Object substance, FieldItem field) { 40 super(substance,field); 41 currency = GuiAC.getDefaultCurrency(); 42 label = new JLabel (); 43 setValue(value); 44 add(label); 45 } 46 47 public void setValue(Object value) { 48 label.setText(value.toString()+" "+currency); 49 } 50 51 protected JComponent getComponent() { 52 return label; 53 } 54 } 55 | Popular Tags |