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 JComponents etc) (what kind of Swing things can replace the AWT)?
Absolutely yes. Legacy swing applications are still supported and enhanced.
Swing is the extension of AWT. It is not the exact replacement of AWT. Hence it has AWT features with the extensibility of JAVA.
AWT provides many ready-made and reusable GUI components in package java. awt . The frequently-used are: Button , TextField , Label , Checkbox , CheckboxGroup (radio buttons), List , and Choice , as illustrated below.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With