Re: Referencing the base method
- From: "Fred Kleinschmidt" <fred.l.kleinmschmidt@xxxxxxxxxx>
- Date: Mon, 17 Jul 2006 15:29:06 GMT
<halfpeaw@xxxxxxxxx> wrote in message
news:1153148540.153999.76410@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I am creating a new custom JTextField object. I am overwriting mysuper.getText()
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()
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
--
Fred L. Kleinschmidt
Boeing Associate Technical Fellow
Technical Architect, Software Reuse Project
.
- References:
- Referencing the base method
- From: halfpeaw
- Referencing the base method
- Prev by Date: Re: Referencing the base method
- Next by Date: Re: what's better way to store a million keys in mem?
- Previous by thread: Re: Referencing the base method
- Next by thread: importing package in eclipse plug in
- Index(es):
Relevant Pages
|