Applets, frames and interface vs class problems <---notice the changed title

So I am currently working on a DnD system for my inventory. I think I got it straightened out to the point that I can build the applet portion and test it.

Well i built 3 classes (player info, equip, and inventory) the DnD is supposed to go between the inventory and equip. Each class extends JPanel and builds a panel or series of panels to create the interface using a border layout :slight_smile:

Well in my main class that extends applet in my init() method or constructor… how do i go about adding the different panels from the classes to the applet? Do i need to change all my 3 classes to jwindows that run inside of the applet and restrict resizing and closing for my purposes? Or do i somehow group them and set them as the main componet in each class doing a getComponet().add(blahblah)?

Im kinda lost here with this. The answer to this will also hopefully get me on the road to finishing the layout stuff for my actual game interface as it uses the same theory on things.

Also, can i do multiple Jwindows in an applet?

you can just take 1 JWindow or JFrame and see to it that they are containers and simply use add() set the Layout to fit your needs etc. from user frendlyness perfective this is the way togo.

DnD? Dungeons and dragons? Do not Disturb?

Drag and Drop :-*

I think i get the idea now.

Each of my classes are extending JPanel and have multiple JPanels that I can add to a JFrame and set the Container.

With doing this I would like the JFrames to be able to resize and minimize but not ever close the JFrame.

What is the setting to not allow the JFrame to ever close?

P.S. It is Drag and Drop (also hoping that the list to label box will work being in seperate classes) :slight_smile:

actually it never closes by default. it only sets setVisible(false);

frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);

and implent your own windowlistener to self controll wenn to close, in good practice you should adleast let the user know why you aren’t allowing the user to close it.

Right now, its because i haven’t setup a key listener or other menu or button to get them back up if i set them to false. I guess i should work that out. :slight_smile: