Discussion Relevance of AWT in Java for Game Development


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:

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.


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.