• Post Reply Bookmark Topic Watch Topic
  • New Topic

Swing or AWT  RSS feed

 
Madhur Baheti
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am planning to design a game of snake. I haven't studied the Java GUI yet and wanna know which one should i go for, Swing or AWT.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It really doesn't matter for Snake... basically you don't need lots of buttons, textfields, comboboxes, etc. You just need a blank area to draw your game on. I would just use AWT... it's simpler to learn and it's easier to make your game an Applet if you want to. Just extend Panel or Canvas and paint all your game graphics in the paint( Graphics g ) method.
 
Dorothy Finkel-Laverty
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wrote a game of Snake in AWT when I was studying for my certification - I found it an excellent drill on AWT, threads, and serialization of files (for keeping track of high scores). However, it would have been SO MUCH SIMPLER if I had written it in Swing.
Fun game to write!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!