This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Re: silly newbie question about inner classes
- From: Per Bothner <per at bothner dot com>
- To: john whittaker <john dot whittaker at sbcglobal dot net>
- Cc: kawa at sourceware dot org
- Date: Thu, 01 Nov 2007 22:09:50 -0700
- Subject: Re: silly newbie question about inner classes
- References: <200711020449.13230.>
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/