I am completely new to doing UI stuff with java. I read through some tutorials and wrote myself a mouse listener like this:
import java.awt.event.MouseEvent;
import java.awt.event.MouseAdapter;
...
class MyPanel extends JPanel {
public MyPanel() {
...
addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
do some stuff
}
});
...
}
}
As I understand it this mouse listener uses AWT, but it would be better if I used Swing. I tried changing it to something like what is shown here , but what confuses me about it is that apparently they import some AWT classes. Does that mean Swing uses AWT components and if yes, how do I know I am "Using swing instead of AWT" ?