FengGUI and jME Tutorial

The problem with disabling it completely is that there will be no key-repeating input at all.

The solution is to add some kind of delay between events.  Unfortunately, I ran into problems

making it work properly.  Something about dropping events not destined for FengGUI.



A note in the wiki would probably be appropriate.

Here's what I changed it to already, down in the explanation section:

The constructor adds an InputAction to listen for all keyboard events. Note that the allow repeating argument is set to false. We don

It was pointed out to me that there was a flaw in FengJMEInputHandler (GASP) when used with the newest version of jME.

Apparently, the InputAction methods have (mostly) been moved into an interface, and it caused a problem with the @Override

annotation in the code.

Long story short, I removed that line, and all is well with the world again!  :smiley:

Not really sure anyone is even following this anymore, but I made another minor update.

Schabby pointed out to me that there is a minor bug in the initGUI() method of the FengJME class.

The following line:



frame.addWidget(list);



should be



frame.getContentContainer().addWidget(list);



Pretty simple.  Wiki is updated.

Not really sure anyone is even following this anymore,


Don't fear, i'm sure this thread is watched closely  8)

May i humbly direct Your attention to the following thread btw    : http://www.jmonkeyengine.com/jmeforum/index.php?topic=4402.0

me too… just want to assure you that there are people reading

and needing this thread… at least 2  :wink:

Here's another "me too".  I'm using Feng and enjoying it.  Nice to know about this little fix.



Jim

Hi friends!



Just a quick note to let you know that we just installed a FengGUI board on http://www.fenggui.org/forum/index.php. Of course, that does not mean that Whackjack and I won't answer your questions in the jME forum anymore. :slight_smile: We will also continue to announce bigger steps here. But in case you got a very FengGUI specific question and dont feel like writing a mail, you can now drop by at our board and post a message there.



tata



Johannes

In FengJME tutorial I am getting that this line has an error:


list.getPopupList().getToggableWidgetGroup().addSelectionChangedListener(new CBListener());



'getPopupList()' was removed from what I can tell.  Has something gone terribly wrong on my end or is it broken?

No, we had to update the ComboBox Widget slightly and did not find the time to update the code in the wiki yet. I catch up with that rigth away. Thanks for reporting it.





list.getList().getToggableWidgetGroup().addSelectionChangedListener(new CBListener());

… should do the trick.



Johannes

Hey, I’m currently working on integrating FengJMEInputHandler to work with my mouseManagement framework. I have to make some simple changes to FengJMEInputHandler and FengJME and redistribute the code bundled with mouse framework to serve as an example on how to integrate the two together.

You have posted FengHandler here: http://www.jmonkeyengine.com/wiki/doku.php?id=fengjmeinputhandler, however there is not a single hint of what kind of license it comes with. Same with FengJME.

Can I redistribute the modified code FengJMEInputHandler and FengJME)? If yes, what license should I include?



As for making FengJMEInputHandler work with software mouse, the changes are very simple: instead of adding the mouseListener directly to MouseInput, I need to add the mouse listener to a class I wrote.



If you want to make FengJMEInputHandler compatible with any software mouse implementation, then the following changes are needed:

  1. remove the line MouseInput.get().addListener(new MouseListener());
  2. add a member vriable MouseListener listener = new MouseListener();
  3. add getMouseListener() method.



    Then the users will have a choice to add the MouseListener to MouseInput directly or add the MouseListener to their own class enabling softwareMouse to work with FengJMEInputHandler.



    EDIT:

    It seems that FengGUI is setting mouse cursors using lwjgl directly. Because of that, the events that change cursor have no way of propagating to the software mouse. So, I want to put in a feature request, for having some class intercepting requests for setting cursors. E.g. ChangeCursorListener. Then one implementation can relay cursor changes directly into the underlying input system (lwjgl or others) and another implementation can relay changes to the software mouse.

Hi. When I try to run FengJME.java I get an error saying that the main class cannot be found, however Eclipse isn’t highlighing any of the code as wrong.

The returned error is:

java.lang.UnsupportedClassVersionError: Bad version number in .class file

at java.lang.ClassLoader.defineClass1(Native Method)

at java.lang.ClassLoader.defineClass(Unknown Source)

at java.security.SecureClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.access$100(Unknown Source)

at java.net.URLClassLoader$1.run(Unknown Source)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClassInternal(Unknown Source)

Exception in thread “main”




Is there some newbie mistake I am making?

I believe that an error like that means something was compiled targeted at a higher Java VM than what you are using.  (Like 1.6 vs 1.5, etc.)

rc (and I) say thank-you muchly!!

Sorry I haven’t been around for a while.  Seems like everyone is using FengGUI and jME to great success  :smiley:

lex, your question about the license.  I wrote that code as a very simplified example of FengGUI and jME interaction, not really as a complete solution. I expected more people would take that and improve on it.  That said, I think it’s only appropriate to follow jME’s more permissive BSD license (FengGUI is LGPL).  I want everyone to be able to use it and learn from it.  If you think it’s good enough to make it in your game, feel free to give me a shout out  :wink:

I haven’t talked to Schabby (FengGUI’s author) in a while, but please feel free to direct any feature requests to him at http://www.fenggui.org.

i got an error in this line


list.addSelectionChangedListener(new CBListener());



CBListener seems not to work anymore. Someone knows how to fix?

thx