.


:




:

































 

 

 

 





 

. titleShift int ., Projects Bean Patterns . Add/Property, .

 

, , -

 

Bound ( ) Constrained ( ) Generate Property Change Support .

Bound . Bound Generate Property Change Support , PropertyChange . NetBeans PropertyChange.

, titleShift (shift- ) Bound, , :

 

/**

* Holds value of property titleShift.

*/

private int titleShift;

 

/**

* Getter for property titleShift.

* @return Value of property titleShift.

*/

public int getTitleShift() {

return this.titleShift;

}

 

/**

* Setter for property titleShift.

* @param titleShift New value of property titleShift.

*/

public void setTitleShift(int titleShift) {

int oldTitleShift = this.titleShift;

this.titleShift = titleShift;

propertySupport.firePropertyChange ("titleShift",

new Integer (oldTitleShift),

new Integer (titleShift));

repaint();//

}

 

, , repaint().

 

Constrained . , . VetoableChangeEvent. Vetoable Veto able - , .

 

- , Bean Patterns, Add/Indexed Property. , , , , :

 

/**

* Holds value of property arr.

*/

private double[] arr;

 

/**

* Indexed getter for property arr.

* @param index Index of the property.

* @return Value of the property at <CODE>index</CODE>.

*/

public double getArr(int index) {

return this.arr[index];

}

 

/**

* Getter for property arr.

* @return Value of property arr.

*/

public double[] getArr() {

return this.arr;

}

 

/**

* Indexed setter for property arr.

* @param index Index of the property.

* @param arr New value of the property at <CODE>index</CODE>.

*/

public void setArr(int index, double arr) {

this.arr[index] = arr;

propertySupport.firePropertyChange ("arr", null, null);

}

 

/**

* Setter for property arr.

* @param arr New value of property arr.

*/

public void setArr(double[] arr) {

double[] oldArr = this.arr;

this.arr = arr;

propertySupport.firePropertyChange ("arr", oldArr, arr);

}

 

(Build main project F11). , (Design) jTitledPanel1, jTitledPanel1[JTitledPanel]-Properties/ Properties .





:


: 2017-02-28; !; : 447 |


:

:

. .
==> ...

747 - | 704 -


© 2015-2024 lektsii.org - -

: 0.013 .