List of usage examples for javax.swing JLabel putClientProperty
public final void putClientProperty(Object key, Object value)
From source file:de.iew.imageupload.widgets.ContentPane.java
public void registerImageFile(File file) { try {//from ww w.j a va 2 s .com ImageIcon imageIcon = new ImageIcon(file.getAbsolutePath()); JLabel imageLabel = new JLabel(imageIcon, JLabel.CENTER); imageLabel.setPreferredSize(new Dimension(100, 100)); imageLabel.setSize(new Dimension(100, 100)); imageLabel.addMouseListener(this.imageMouseClickHandler); imageLabel.setBackground(Color.WHITE); imageLabel.setBorder(new EmptyBorder(10, 10, 10, 10)); imageLabel.putClientProperty("Image File", file); this.imageGridPane.add(imageLabel); this.imageGridPane.revalidate(); } catch (Exception e) { e.printStackTrace(); } }