kohinoor2007
Programmer
Hi guys,
Have a class ,which Iam extending from "JTextField" under swing.Want to overide the " setText" function as follows:
Want to set a flag before I call the super class "SetText".How could I achieve it....
public void setText(String text){
val = true; // "Val" is a boolean declared in the class.
super().setText(text); // this gives a compile time error.
val = false;
}
Have implemented a DocumentEvent which is fired each time characters are inserted or removed from a text component.
The event is also fired if the set of attributes in the text component is changed.That I want to avoid.Thats why Iam overriding the "setText".
How can I modify my overrided "setText" function the way I have described,so that I can call the super "setText" function...
Thanks in advance......