Reputation: 4952
I trying to create some sort of interface from scratch for objects that can be dragged and dropped using some sort of EventListener. I can't directly use any of javax.swing classes because I'm not dealing with Components; however, I have a made my own custom ActionEvent class by extending EventObject, so doing something like is fair play for me.
This is for a game engine, and more specifically for an inventory in a game. The items that are dragged around are Sprites, but I want this to be general enough to allow a very basic Class to be dragged. The item holder is called ItemHolder and contains a Sprite.
I'd just like some general advice on this; perhaps some links to examples. This is probably not going to be a very popular topic in Java, so something in a different language is fine too.
Thank you.
Upvotes: 3
Views: 1000
Reputation: 18980
If you're not doing this in a browser, then there are ways to do this using Swing user interface.
If you're developing a Java application server side, using a web browser, my recommendation is to use the Yahoo User Interface (YUI) framework or the jQuery framework and their drag and drop features. There are so many cross browser compatibility issues you'll run into while developing something yourself if you want it to work in all browsers, it probably won't be worth your time if there are resources already available. Just a suggestion.
Upvotes: 2