Java-Gaming.org    
Featured games (78)
games approved by the League of Dukes
Games in Showcase (426)
Games in Android Showcase (89)
games submitted by our members
Games in WIP (466)
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  
  Java GUI tutorial  (Read 1237 times)
0 Members and 1 Guest are viewing this topic.
Offline Juriy

Junior Member





« Posted 2006-05-18 12:59:10 »

Hi there!

Could you please suggest a good tutorial about creating GUI with Java?

I know the basic technique from official Sun swing tutorial, and i do not need any recomendations on how to put a button on the panel.

But I realy want to improve the architectural design of my GUI apps. Currently my code looks like a heap of swing calls and it is definitly not what people call OOP. Well maybe someone can suggest a tutorial like "creating a good GUI code with Java".

BTW, how you implement your GUIs? Do you use some designer applications or do all this things manually?

http://voituk.kiev.ua - java tutorials, tips and tricks (Russian)
Offline Mr_Light

Senior Member




shiny.


« Reply #1 - Posted 2006-05-18 14:33:12 »

Have you looked at the Action Framework yet?

http://java.sun.com/docs/books/tutorial/uiswing/misc/index.html

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 cylab

JGO Knight


Medals: 34



« Reply #2 - Posted 2006-05-18 15:14:23 »

Quote
BTW, how you implement your GUIs? Do you use some designer applications or do all this things manually?

I would suggest using the Netbeans GUI editor. While some people don't like Netbeans as an IDE, the GUI-Editor is by far the best one I found for Java. Keep in mind that you have to include an extra Jar for GUIs created with the new Matisse (Group-Layout). You can avoid that by using the traditional LayoutManagers (I prefer GridBagLayout), but layouting them visually is not as nice as with the new one.

More information here: http://www.netbeans.org/kb/articles/matisse.html

Mathias - I Know What [you] Did Last Summer!
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Kova

Senior Member





« Reply #3 - Posted 2006-05-18 17:18:33 »

unfortunatly in my experience using Swing is a bunch of calls as you say Juriy.... I hate it.
btw. I'm using SpringLayout, IMHO the best standart layout.
Offline Juriy

Junior Member





« Reply #4 - Posted 2006-05-18 18:51:06 »

Quote
I'm using SpringLayout, IMHO the best standart layout.

Currently I'm using null layout  Smiley

Okay... Just few more architectural questions... Do you guys use separate classes to adequatly manage GUI parts like main menu, or dialogs, or just put it all together in one class? Maybe there is some design patterns for GUI? I've got a strong feeling that I'm trying to invent a wheel, when I experiment with different GUI approaches like MVC (I don't like it very much)...

http://voituk.kiev.ua - java tutorials, tips and tricks (Russian)
Offline Mr_Light

Senior Member




shiny.


« Reply #5 - Posted 2006-05-18 20:45:09 »

null layout Lips Sealed this better be for a game.

offcourse you seperate your gui over and amount of classes, one big class is unmaintable/error prone. null Layout makes your layout static, limiting the amount of screens that your app is workable under greatly. See websites and absolute sizes.

you have to decide if you go the WYSIWYG editor or simply code it.

I take gui parts generaly in two ways; I have building blocks eg components, or parts that (pritty much) follow the navigation hierarchy. I used to have plain action listeners to capture functiononality (which tries to follows usecases/senario's) since that lead to cumsyness  with respects to states.... anyways I then noticed the swing Action's and all was well.

that takes part of the coding end and then you have to scratch your head how to increase the accessability of your application.

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 swpalmer

JGO Coder




Where's the Kaboom?


« Reply #6 - Posted 2006-05-19 01:28:16 »

Only use null layout when you have full control of the sizes of your components, down to the pixel.  If you allow anything to be it's "natural" size then a null layout is likely a bad idea.

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.

xsi3rr4x (75 views)
2014-04-15 18:08:23

BurntPizza (68 views)
2014-04-15 03:46:01

UprightPath (80 views)
2014-04-14 17:39:50

UprightPath (65 views)
2014-04-14 17:35:47

Porlus (81 views)
2014-04-14 15:48:38

tom_mai78101 (105 views)
2014-04-10 04:04:31

BurntPizza (165 views)
2014-04-08 23:06:04

tom_mai78101 (261 views)
2014-04-05 13:34:39

trollwarrior1 (210 views)
2014-04-04 12:06:45

CJLetsGame (220 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
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!