• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Discussion Relevance of AWT in Java for Game Development

Odolwa

Member
Hey, folks. I've been using GM for a number of years now but only recently started taking a look at Java as a side-project to improve my coding. As part of that process I've been browsing some online tutorials but I'm a bit confused on one point. I've heard that the AWT(Abstract Window Toolkit) has been deprecated for some years now yet some of the tutorials I've seen posted as recently as last year on programming have lines importing AWT, like:

Java:
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
Should/can these lines be replaced by code using Swing (based off of AWT, apparently) type code instead, or do Java (game) developers still use AWT? I'm kind of confused what is or isn't used by Java programmers right now. Does anyone have any insight? Thanks.
 

Mercerenies

Member
Swing is built on AWT. To use Swing correctly, you'll import lots of things from AWT. AWT isn't deprecated; we built something cooler on top of it. Using the cooler thing still requires using the underlying framework at the same time.
 
Top