javaswingawtlistenerlayout-manager

Swing GUI listeners without AWT


I am a starting Java developer, learning just from internet tutorials. I am learning full-screen GUI applications. I was told yesterday that I shouldn't use AWT in my programs because it is outdated. I already know about light and heavyweight components, the main problem is the mouse and keyboard listeners. Why is AWT outdated?

How to make a program without AWT (adding listeners to a JComponent etc)? What kind of Swing things can replace the AWT?


Solution

  • You're mis-interpreting the information given to you. You should avoid using Swing components with AWT components. It's OK to use Swing with the AWT listener structure, layout managers, etc. and in fact it's impossible not to.