Re: Referencing the base method



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

.



Relevant Pages

  • Re: Referencing the base method
    ... existing getText() method inside of it. ... public Class CustJTextField extends JTextField { ... public String getText() { ... Boeing Associate Technical Fellow ...
    (comp.lang.java.programmer)
  • Referencing the base method
    ... I am creating a new custom JTextField object. ... existing getText() method inside of it. ... public Class CustJTextField extends JTextField { ... public String getText() { ...
    (comp.lang.java.programmer)
  • Re: LOST in HELL: pointers unsafe/fixed, TCHAR, and win32api...please help?
    ... > unsafe/fixed pointer coding. ... > what's strange is that the gettext string (which holds the screen name ... > public static extern int SendMessage( ... > public static extern int SendMessageByString( ...
    (microsoft.public.dotnet.csharp.general)