KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jimm > datavision > layout > swing > SwingImageField


1 package jimm.datavision.layout.swing;
2 import jimm.datavision.field.ImageField;
3 import javax.swing.*;
4
5 /**
6  * An image.
7  *
8  * @author Jim Menard, <a HREF="mailto:jimm@io.com">jimm@io.com</a>
9  * @see SwingLE
10  * @see jimm.datavision.field.ImageField
11  */

12 public class SwingImageField extends AbstractSwingField {
13
14 /**
15  * Constructor.
16  *
17  * @param f image field
18  */

19 public SwingImageField(ImageField f) {
20     super(f, new JLabel());
21     format();
22 }
23
24 /**
25  * Loads the image.
26  */

27 public void format() {
28     ((JLabel)component).setIcon(((ImageField)field).getImageIcon());
29     makeBorders();
30 }
31
32 }
33
Popular Tags