Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java 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 JComponents etc) (what kind of Swing things can replace the AWT)?

like image 269
Hidde Avatar asked Jun 06 '11 16:06

Hidde


People also ask

Do people still use Java AWT?

Absolutely yes. Legacy swing applications are still supported and enhanced.

Is Swing replacing AWT?

Swing is the extension of AWT. It is not the exact replacement of AWT. Hence it has AWT features with the extensibility of JAVA.

Is AWT used for GUI programming in 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.


1 Answers

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.

like image 108
Hovercraft Full Of Eels Avatar answered Sep 22 '22 13:09

Hovercraft Full Of Eels