Re: Referencing the base method
- From: Rogan Dawes <discard@xxxxxxxxxxxx>
- Date: Mon, 17 Jul 2006 17:11:12 +0200
halfpeaw@xxxxxxxxx wrote:
I am creating a new custom JTextField object. I am overwriting my
existing getText() method inside of it. The problem I am having is I
don't know to get the text from the actual text field while I'm in my
new getText() method. I tried casting my object but that didn't work.
so my overall code looked something like this:
public Class CustJTextField extends JTextField {
private int length;
CustJTextField(int length) {
this.length = length
}
public String getText() {
String text = ((JtextField)this).getText()
String text = super.getText();
if (text.length() > length) {.
return null;
}
return text
}
}
Thats a much simpler form of what I'm coding, but you should be able to
get the idea. Unfortunately calling the getText method with in my
custom GetText method, ends up with a stack overflow error. Is there
some way to reference the base method? Thanks for any help you guys
can provide
- References:
- Referencing the base method
- From: halfpeaw
- Referencing the base method
- Prev by Date: Re: Getting file into an array of byte..
- Next by Date: Re: Referencing the base method
- Previous by thread: Referencing the base method
- Next by thread: Re: Referencing the base method
- Index(es):
Relevant Pages
|