Without layout-manager you can do absolute positioning of components, but be aware that it will most likely look completely crap and unprofessional on other systems than yours. So always use layout managers, unless... hm... I can't think of a reason not to.

Good luck with your GUIs, and don't forget to read the javadocs/guide from sun.

Hi, appreciate more people! Σ ♥ = ¾Learn how to award medals... and work your way up the social rankings!

BUT if we are talkign abotu games then mnost dont use ANY Swing or AWT at all beyond AWT buffer flipping (assuming we are talkign about a 2D game. A 3D game, and even some 2D games dont use AWT at all but just render through OGL)

Got a question about Java and game programming? Just new to the Java Game Development Community? Try my FAQ. Its likely you'll learn something!

Ive read the entire javadoc on the different layout managers. But thanx for the extra info. What I can't deside is.... My first Java project has been a simple 2 player battle applet that works pretty well for text. I just added a background image to it that defines areas where the players/monster pictures are supposed to be, the status objects such as HP, Hit, DMG, the 3 buttons (Attack, Reset, Exit), and the Status window which im hoping to use for a scrolling history of hit, misses, and damage dealt.

But after reading the different layout managers that java uses. I can't figure out a way beyond not using any at all that I could position these items where I want them. And i guess considering that the applet will never be bigger then the size i set it as in my applet tags on the html page then it shouldn't distort.

After the layout is done i will start working on DB connectivity that should be fun! But for now I'm really not sure what to use to lay it out. Also since everywhere I read they are saying to use a layout manager... how do i define where my buttons and such are supposed to go if i setLayout (null); ??

But after reading the different layout managers that java uses. I can't figure out a way beyond not using any at all that I could position these items where I want them. And i guess considering that the applet will never be bigger then the size i set it as in my applet tags on the html page then it shouldn't distort.

Most of the time you aren't going to be able to achieve the results you want by by attemptinig to layout all of the components with a single LayoutManager. What you have to do is make use of Panel objects. Look at the layout you're after and see how components can logically be grouped together in different areas of the screen. Divide the window up along the lines of those component groups. For each group, create a Panel and add the components of that group to the Panel. Each Panel object will use its own LayoutManager to get its components in the right positions within the Panel. With the components properly positioned in each Panel you can use a single LayoutManager to position the Panels appropriately within the frame. Using this technique you can easily create some complex layouts.

You can also have multiple nested panels. That is why I pointed you to that particular tutorial. It gives a lot of good tips on how to use the LayoutManagers together to achieve what you want. After I read that tutorial, I could create any layout that I wanted.

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