I'm having some trouble building a GWT application.
Here: https://developers.google.com/web-toolkit/tools/gwtdesigner/features/menu_editing Google themselves talk of the possibility of Java Swing, JFrame implementation in the GWT. I am a Java newbie and don't know what the SWT equivalent of Swing is, so I haven't tried that option.
When I try to run my code (which is built from the GWT Designer) I get errors at each line that uses JFrame:
JFrame frame = new JFrame();
JMenuBar menuBar = new JMenuBar();
frame.setJMenuBar(menuBar);
JMenu mnNewMenu = new JMenu("Test");
menuBar.add(mnNewMenu);
JMenu mnNewMenu_1 = new JMenu("Test");
mnNewMenu.add(mnNewMenu_1);
Returning: [ERROR] [gwtearthdemo] - Line 96: No source code is available for type javax.swing.JFrame; did you forget to inherit a required module?
Ditto for JMenuBar, JMenu.
I have seen errors similar to this with answers suggesting that the function in question is not applicable to GWT. However, Google suggests it is. Any advice here?
In GWT you are restricted to use only some of the java classes since it is not possible to convert all the java classes to javascript. You can find a list of the allowed classes in this link: List of Classes
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With