当 继承JLabel
当 继承JLabel怎么把ImageIcon设置进JLabel里面
public class Aa extends JFrame{
Container con;
public Aa(){
con=this.getContentPane();
this.setSize(650,550);
this.setVisible(true);
this.setLocationRelativeTo(null);
this.setDefaultCloseOperation(3);
this.setResizable(false);
}
public static void main(String[] args) {
new Aa();
}
}
class Bb extends JLabel{
public Bb(String x,String y,String mapX,String mapY,String path,Container con){
ImageIcon img = new ImageIcon(path);
this.setBounds(x,y, img.getIconWidth(), img.getIconHeight());
}
}