import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class Main extends JFrame {
Container c;
public Main() {
c.setLayout(BorderLayout);
setDefaultCloseOperation(EXIT_ON_CLOSE);
ImageIcon icon1 = new ImageIcon("Tetris Block 1.PNG");
ImageIcon icon2 = new ImageIcon("Tetris Block 2.PNG");
ImageIcon icon3 = new ImageIcon("Tetris Block 3.PNG");
ImageIcon icon4 = new ImageIcon("Tetris backg.PNG");
JLabel[]la=new JLabel[3];
ImageIcon[] names = {icon1, icon2, icon3, icon4};
for(int i=0;i<4;i++) {
la[i]=new JLabel(names[i]);
c.add(la[i]);
la[i].addMouseListener(new MyMouseListener);
la[i].addKeyListener(new MyKeyListener);
}
//c.setBackground(icon4);
setSize(500,500);
setVisible(true);
}
public static void main(String[] args) {
new Main();
}
}