Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (542)
Games in Android Showcase (133)
games submitted by our members
Games in WIP (604)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Applets, frames and interface vs class problems <---notice the changed title  (Read 1186 times)
0 Members and 1 Guest are viewing this topic.
Offline straydoginc

Junior Devvie





« Posted 2006-01-04 19:45:14 »

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 Smiley

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?
Offline Mr_Light

Senior Devvie


Medals: 1


shiny.


« Reply #1 - Posted 2006-01-06 11:31:03 »

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.

It's harder to read code than to write it. - it's even harder to write readable code.

The gospel of brother Riven: "The guarantee that all bugs are in *your* code is worth gold." Amen brother a-m-e-n.
Offline Ask_Hjorth_Larsen

Junior Devvie




Java games rock!


« Reply #2 - Posted 2006-01-07 00:55:31 »

DnD? Dungeons and dragons? Do not Disturb?
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Mr_Light

Senior Devvie


Medals: 1


shiny.


« Reply #3 - Posted 2006-01-07 12:56:34 »

Drag and Drop  Kiss

It's harder to read code than to write it. - it's even harder to write readable code.

The gospel of brother Riven: "The guarantee that all bugs are in *your* code is worth gold." Amen brother a-m-e-n.
Offline straydoginc

Junior Devvie





« Reply #4 - Posted 2006-01-08 02:26:29 »

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) Smiley
Offline Mr_Light

Senior Devvie


Medals: 1


shiny.


« Reply #5 - Posted 2006-01-08 13:17:27 »

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.

It's harder to read code than to write it. - it's even harder to write readable code.

The gospel of brother Riven: "The guarantee that all bugs are in *your* code is worth gold." Amen brother a-m-e-n.
Offline straydoginc

Junior Devvie





« Reply #6 - Posted 2006-01-11 20:32:43 »

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. Smiley
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Elsealabs (11 views)
2014-12-28 10:39:27

CopyableCougar4 (17 views)
2014-12-28 02:10:29

BurntPizza (21 views)
2014-12-27 22:38:51

Mr.CodeIt (14 views)
2014-12-27 04:03:04

TheDudeFromCI (19 views)
2014-12-27 02:14:49

Mr.CodeIt (26 views)
2014-12-23 03:34:11

rwatson462 (57 views)
2014-12-15 09:26:44

Mr.CodeIt (47 views)
2014-12-14 19:50:38

BurntPizza (94 views)
2014-12-09 22:41:13

BurntPizza (115 views)
2014-12-08 04:46:31
How do I start Java Game Development?
by gouessej
2014-12-27 19:41:21

Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!