No signature of method: javax.swing.JMenu.setMnemonic()

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

No signature of method: javax.swing.JMenu.setMnemonic()

Paolo Di Tommaso
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


I saw this was an issue with Groovy 3 beta, however, I'm using Groovy 3.0.5, Java 8 on MacOS. 

 

Any clue what's could be the problem? 


Thanks,
Paolo

Reply | Threaded
Open this post in threaded view
|

Re: No signature of method: javax.swing.JMenu.setMnemonic()

Mariusz W
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 <[hidden email]> 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


I saw this was an issue with Groovy 3 beta, however, I'm using Groovy 3.0.5, Java 8 on MacOS. 

 

Any clue what's could be the problem? 


Thanks,
Paolo

Reply | Threaded
Open this post in threaded view
|

Re: No signature of method: javax.swing.JMenu.setMnemonic()

Paolo Di Tommaso
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 <[hidden email]> 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 <[hidden email]> 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


I saw this was an issue with Groovy 3 beta, however, I'm using Groovy 3.0.5, Java 8 on MacOS. 

 

Any clue what's could be the problem? 


Thanks,
Paolo