This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: silly newbie question about inner classes


Per,

Thank you so much for the quick response.  If I might
amplify a bit, I have another question.

How would I create a subclass of
javax.swing.text.html.HTMLEditorKit.$ParserCallback?

Doing something like this (below) doesn't work:

(define-simple-class my-parser-callback (
<javax.swing.text.html.HTMLEditorKit.$ParserCallback>
)
   ((handleText (data :: <char[]>)  (pos :: <int>))
::<void> access: 'public
    (write data) (newline))

Thanks,

John Whittaker

--- Per Bothner <per@bothner.com> wrote:

> john whittaker wrote:
> > I apologize if this is a really silly question. 
> I'm new to both Kawa and 
> > Java, so I may not even be asking the question
> correctly.
> 
> It's a perfectly fine question.  Wkecine to Kawa and
> to Java!
> 
> > Suppose I want to create an instance of an inner
> class such as 
> >
> javax.swing.text.html.HTMLEditorKit.ParserCallback. 
> I cannot seem to do this 
> > in Kawa.  Here is an example of the simple-minded
> thing I tried:
> > 
> > #|kawa:16|#
>
(javax.swing.text.html.HTMLEditorKit.ParserCallback:new)
> 
> Since Kawa uses colon as a "get-named-component"
> operator,
> I think this *should* work, but it doesn't:
>
(javax.swing.text.html.HTMLEditorKit.ParserCallback:new)
> 
> However, this works:
>
(javax.swing.text.html.HTMLEditorKit$ParserCallback:new)
> 
> It works because that is the actual "internal name".
> 
> You can also leave out the ":new", since "applying"
> a class
> creates an instance:
> 
> (javax.swing.text.html.HTMLEditorKit$ParserCallback)
> -- 
> 	--Per Bothner
> per@bothner.com   http://per.bothner.com/
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]