Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (636)
Games in Android Showcase (178)
games submitted by our members
Games in WIP (685)
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  
  Jpanels, panes, containers and other stuff  (Read 1335 times)
0 Members and 1 Guest are viewing this topic.
Offline straydoginc

Junior Devvie

« Posted 2005-12-02 15:01:29 »

Okay in theory im hoping this is going to work. I set my applet to be 640 x 480 for the game screen. This screen is sectioned into 4 panes.

I am making each pane as a seperate class and hoping to add it to the container on the main class with each pane adding its own stuff to itself (buttons, strings, images, etc) and will be using GridBag Layout as each pane is a different size and doesn't do a 2,2 layout.

But. Since I am a n00b at java and know very little cause of experience. Im not sure if this is going to work. Does this sound like a right track or do i need to use the contructor and init() stuff on the main class to build and add items to each pane?
Offline CaptainJester

JGO Knight

Medals: 12
Projects: 2
Exp: 14 years

Make it work; make it better.

« Reply #1 - Posted 2005-12-02 17:59:57 »

Sounds like you are doing ti right.

Offline noblemaster

« JGO Spiffy Duke »

Medals: 24
Projects: 10

Age of Conquest makes your day!

« Reply #2 - Posted 2005-12-02 18:59:22 »

Yes, sounds good. However, I noticed you mentioned "GridBagLayout".
Pretty much all the layout classes provided with the Java Standard package
are rather weak!

I stopped using them some time ago. The way to go is the "FormLayout"
class. You can find it at
You can very flexible define the cell sizes etc. Same if you want to add buttons
and text to a panel.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline straydoginc

Junior Devvie

« Reply #3 - Posted 2005-12-02 20:35:29 »

Holy cow that looks neat. Imma check it out and see if it'll work for me. Learning more stuff all the time!

Im sure ill have much for questions after reading more into it!
Offline noblemaster

« JGO Spiffy Duke »

Medals: 24
Projects: 10

Age of Conquest makes your day!

« Reply #4 - Posted 2005-12-02 21:18:52 »

Yep! It's cool. Also, it's much better than wasting your time with the standard java layout classes!
Don't use GridLayout, GridBagLayout ... they just suck.

Offline straydoginc

Junior Devvie

« Reply #5 - Posted 2005-12-07 17:58:50 »

After reading the site for this.. im not sure how to implement this system? Any pointers. all i see are free downloads which give me examples but not sure if i just use their code and change stuff or is this a language i integrate into eclipse
Offline noblemaster

« JGO Spiffy Duke »

Medals: 24
Projects: 10

Age of Conquest makes your day!

« Reply #6 - Posted 2005-12-07 19:30:48 »

You do NOT need Eclipse. You can use the classes by themselves. For the layout,
just put "jgoodies-forms.jar" (or something like that) into your classpath. The "forms"
jar contains the layout classes.

The article is little bit hidden, but here it is (you should skim through it so you get the

And here how it would look to layout some stuff:
FormLayout layout = new FormLayout(
    “pref, 4dlu, 50dlu, 4dlu, min”, // columns
    “pref, 2dlu, pref, 2dlu, pref”); // rows
JPanel panel = new JPanel(layout);
CellConstraints cc = new CellConstraints();

panel.add(new JLabel(“Label1”), cc.xy (1, 1));
panel.add(textField1, cc.xyw(3, 1, 3));

I didn't use the "look" package for look & feel. But there should be some info on their
web site as well.

Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

Dwinin (58 views)
2015-11-07 13:29:08

Rems19 (72 views)
2015-10-31 01:36:56

Rems19 (63 views)
2015-10-31 01:32:37

williamwoles (101 views)
2015-10-23 10:42:59

williamwoles (87 views)
2015-10-23 10:42:45

Jervac_ (102 views)
2015-10-18 23:29:12

DarkCart (128 views)
2015-10-16 00:58:11

KaiHH (112 views)
2015-10-11 14:10:14

KaiHH (148 views)
2015-10-11 13:26:18

BurntPizza (162 views)
2015-10-08 03:11:46
Rendering resources
by Roquen
2015-11-13 14:37:59

Rendering resources
by Roquen
2015-11-13 14:36:58

Math: Resources
by Roquen
2015-10-22 07:46:10

Networking Resources
by Roquen
2015-10-16 07:12:30

Rendering resources
by Roquen
2015-10-15 07:40:48

Math: Inequality properties
by Roquen
2015-10-01 13:30:46

Math: Inequality properties
by Roquen
2015-09-30 16:06:05

HotSpot Options
by Roquen
2015-08-29 11:33:11 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‑
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!