You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@groovy.apache.org by Paolo Di Tommaso <pa...@gmail.com> on 2020/10/11 17:34:34 UTC
No signature of method: javax.swing.JMenu.setMnemonic()
Dear all,
I'm getting this exception while launching the Groovy console from my app.
groovy.lang.MissingMethodException: No signature of method:
javax.swing.JMenu.setMnemonic() is applicable for argument types: (String)
values: [F]
Possible solutions: setMnemonic(char), setMnemonic(int), getMnemonic()
at
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:70)
at
org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:76)
at
org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:80)
at
org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:194)
at
groovy.ui.view.MacOSXMenuBar$_run_closure1.doCall(MacOSXMenuBar.groovy:79)
at
groovy.ui.view.MacOSXMenuBar$_run_closure1.doCall(MacOSXMenuBar.groovy)
:
Complete stack trace here <https://pastebin.pl/view/0e4fbff3>.
I saw this was an issue with Groovy 3 beta
<https://issues.apache.org/jira/browse/GROOVY-8253>, however, I'm using
Groovy 3.0.5, Java 8 on MacOS.
Any clue what's could be the problem?
Thanks,
Paolo
Re: No signature of method: javax.swing.JMenu.setMnemonic()
Posted by Paolo Di Tommaso <pa...@gmail.com>.
Turns out here the problem was that since I'm using a custom classloader,
it was not applying properly the extensions methods defined in groovy-swing
module.
p
On Thu, Oct 15, 2020 at 11:15 AM Paolo Di Tommaso <pa...@gmail.com>
wrote:
> Unfortunately no. Not sure how to address it because it seems a type
> conversion problem in the `MacOSXmenuBar`
>
> ```
> menu(text: 'File', mnemonic: 'F') {
> menuItem(newFileAction, icon:null)
> menuItem(newWindowAction, icon:null)
> menuItem(openAction, icon:null)
> separator()
> menuItem(saveAction, icon:null)
> menuItem(saveAsAction, icon:null)
> separator()
> menuItem(printAction, icon:null)
> }
> ```
>
> it should be
>
> ```
> menu(text: 'File', mnemonic: 'F' as char)
> ```
>
>
> On Tue, Oct 13, 2020 at 9:18 PM Mariusz W <ma...@gmail.com> wrote:
>
>> Hi,
>> Have you resolved that issue?
>> I have done some tests but on Windows and it works ok.
>>
>> Regards,
>> M
>>
>> On Sun, 11 Oct 2020 at 19:35, Paolo Di Tommaso <pa...@gmail.com>
>> wrote:
>>
>>> Dear all,
>>>
>>> I'm getting this exception while launching the Groovy console from my
>>> app.
>>>
>>>
>>> groovy.lang.MissingMethodException: No signature of method:
>>> javax.swing.JMenu.setMnemonic() is applicable for argument types: (String)
>>> values: [F]
>>> Possible solutions: setMnemonic(char), setMnemonic(int), getMnemonic()
>>> at
>>> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:70)
>>> at
>>> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:76)
>>> at
>>> org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:80)
>>> at
>>> org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:194)
>>> at
>>> groovy.ui.view.MacOSXMenuBar$_run_closure1.doCall(MacOSXMenuBar.groovy:79)
>>> at
>>> groovy.ui.view.MacOSXMenuBar$_run_closure1.doCall(MacOSXMenuBar.groovy)
>>> :
>>> Complete stack trace here <https://pastebin.pl/view/0e4fbff3>.
>>>
>>>
>>> I saw this was an issue with Groovy 3 beta
>>> <https://issues.apache.org/jira/browse/GROOVY-8253>, however, I'm using
>>> Groovy 3.0.5, Java 8 on MacOS.
>>>
>>>
>>>
>>> Any clue what's could be the problem?
>>>
>>>
>>> Thanks,
>>> Paolo
>>>
>>>
Re: No signature of method: javax.swing.JMenu.setMnemonic()
Posted by Paolo Di Tommaso <pa...@gmail.com>.
Unfortunately no. Not sure how to address it because it seems a type
conversion problem in the `MacOSXmenuBar`
```
menu(text: 'File', mnemonic: 'F') {
menuItem(newFileAction, icon:null)
menuItem(newWindowAction, icon:null)
menuItem(openAction, icon:null)
separator()
menuItem(saveAction, icon:null)
menuItem(saveAsAction, icon:null)
separator()
menuItem(printAction, icon:null)
}
```
it should be
```
menu(text: 'File', mnemonic: 'F' as char)
```
On Tue, Oct 13, 2020 at 9:18 PM Mariusz W <ma...@gmail.com> wrote:
> Hi,
> Have you resolved that issue?
> I have done some tests but on Windows and it works ok.
>
> Regards,
> M
>
> On Sun, 11 Oct 2020 at 19:35, Paolo Di Tommaso <pa...@gmail.com>
> wrote:
>
>> Dear all,
>>
>> I'm getting this exception while launching the Groovy console from my
>> app.
>>
>>
>> groovy.lang.MissingMethodException: No signature of method:
>> javax.swing.JMenu.setMnemonic() is applicable for argument types: (String)
>> values: [F]
>> Possible solutions: setMnemonic(char), setMnemonic(int), getMnemonic()
>> at
>> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:70)
>> at
>> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:76)
>> at
>> org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:80)
>> at
>> org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:194)
>> at
>> groovy.ui.view.MacOSXMenuBar$_run_closure1.doCall(MacOSXMenuBar.groovy:79)
>> at
>> groovy.ui.view.MacOSXMenuBar$_run_closure1.doCall(MacOSXMenuBar.groovy)
>> :
>> Complete stack trace here <https://pastebin.pl/view/0e4fbff3>.
>>
>>
>> I saw this was an issue with Groovy 3 beta
>> <https://issues.apache.org/jira/browse/GROOVY-8253>, however, I'm using
>> Groovy 3.0.5, Java 8 on MacOS.
>>
>>
>>
>> Any clue what's could be the problem?
>>
>>
>> Thanks,
>> Paolo
>>
>>
Re: No signature of method: javax.swing.JMenu.setMnemonic()
Posted by Mariusz W <ma...@gmail.com>.
Hi,
Have you resolved that issue?
I have done some tests but on Windows and it works ok.
Regards,
M
On Sun, 11 Oct 2020 at 19:35, Paolo Di Tommaso <pa...@gmail.com>
wrote:
> Dear all,
>
> I'm getting this exception while launching the Groovy console from my app.
>
>
> groovy.lang.MissingMethodException: No signature of method:
> javax.swing.JMenu.setMnemonic() is applicable for argument types: (String)
> values: [F]
> Possible solutions: setMnemonic(char), setMnemonic(int), getMnemonic()
> at
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:70)
> at
> org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:76)
> at
> org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:80)
> at
> org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:194)
> at
> groovy.ui.view.MacOSXMenuBar$_run_closure1.doCall(MacOSXMenuBar.groovy:79)
> at
> groovy.ui.view.MacOSXMenuBar$_run_closure1.doCall(MacOSXMenuBar.groovy)
> :
> Complete stack trace here <https://pastebin.pl/view/0e4fbff3>.
>
>
> I saw this was an issue with Groovy 3 beta
> <https://issues.apache.org/jira/browse/GROOVY-8253>, however, I'm using
> Groovy 3.0.5, Java 8 on MacOS.
>
>
>
> Any clue what's could be the problem?
>
>
> Thanks,
> Paolo
>
>