I read on SO that mixing awt and swing is not really a good approach for GUI programming in Java. I cannot though, find any examples which does not use some awt components while using swing. For example, even when using swing, most of the example I have encountered will use awt for layout and event handling.
That being said, what does it mean not to mix swing and awt in GUI programming using Java? Does it just mean not to borrow graphical widgets such as button, canvas from swing and awt at the same time or just completely use swing or awt alone? Or it is okay to use graphical units ( like buttons, panels) from swing and event handling and layout from awt?
Most of the time the imports will look at least like this:
import javax.swing.*;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.Color;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
I might be wrong but I have not seen example using completely swing without awt or looking at this in a wrong way since I am new to Java GUI.