1 7 8 package org.jdesktop.swing.data; 9 10 import java.awt.Image ; 11 12 import java.awt.image.BufferedImage ; 13 14 import java.net.MalformedURLException ; 15 import java.net.URL ; 16 17 import java.util.ArrayList ; 18 import java.util.Date ; 19 import java.util.List ; 20 import java.util.Map ; 21 import java.util.HashMap ; 22 23 26 public class TestBean { 27 28 private String sValue = "A String"; 29 30 private int iValue = 17; 32 private float fValue = 0.17f; 33 private boolean bValue = false; 34 35 private Date date = new Date (); 37 private Image image; 38 private String [] array = { "Monday", "Tuesday", "Wednesday", "Thursday", 39 "Friday", "Saturday", "Sunday" }; 40 41 private List list; 42 private Map map; 43 44 private Link link; 46 47 public TestBean() { 48 49 list = new ArrayList (); 51 map = new HashMap (); 52 for (int i = 0; i < array.length; i++) { 53 list.add(array[i]); 54 map.put(new Integer (i), array[i]); 55 } 56 57 URL testURL; 58 try { 59 testURL = new URL ("http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4488581"); 60 } catch (MalformedURLException ex) { 61 throw new RuntimeException (ex); 62 } 63 64 link = new Link("4488581", "_blank", testURL); 65 } 66 67 public void setString(String s) { sValue = s; } 68 public String getString() { return sValue; } 69 70 public void setInteger(int i) { iValue = i; } 71 public int getInteger() { return iValue; } 72 73 public void setFloat(float f) { fValue = f; } 74 public float getFloat() { return fValue; } 75 76 public void setBoolean(boolean b) { bValue = b; } 77 public boolean getBoolean() { return bValue; } 78 79 public void setDate(Date d) { date = d; } 80 public Date getDate() { return date; } 81 82 public void setImage(Image i) { image = i; } 83 public Image getImage() { return image; } 84 85 public String [] getArray() { return array; } 86 public void setArray(String [] array) { this.array = array; } 87 88 public List getList() { return list; } 89 public void setList(List list) { this.list = list; } 90 91 public Map getMap() { return map; } 92 public void setMap(Map map) { this.map = map; } 93 94 public Link getLink() { return link; } 95 public void setLink(Link link) { this.link = link; } 96 } 97 | Popular Tags |