KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > test > editor > app > core > properties > IntegerProperty


1 /*
2  * StringProperty.java
3  *
4  * Created on December 10, 2002, 5:50 PM
5  */

6
7 package org.netbeans.test.editor.app.core.properties;
8
9 /**
10  *
11  * @author eh103527
12  */

13 public class IntegerProperty implements Property {
14     
15     private int value = 0;
16     
17     /** Creates a new instance of StringProperty */
18     public IntegerProperty(int value) {
19         this.value=value;
20     }
21     
22     public String JavaDoc getProperty() {
23         return Integer.toString(value);
24     }
25     
26     public void setProperty(String JavaDoc value) {
27         try {
28             this.value=Integer.parseInt(value);
29         } catch (NumberFormatException JavaDoc ex) {
30             ex.printStackTrace();
31         }
32     }
33     
34     public int getValue() {
35         return value;
36     }
37 }
38
Popular Tags