I'm trying to get image built from tiled set of images So to JPanel I'm adding JButtons with ImageIcons. All images are in folder with my classes (NetBeans), and they're named u1, u2, ..., u16. But on button there is no image shown. What am I doing wrong ?
JPanel panel = new JPanel(new GridLayout(4, 4, 3, 3));
for (int i = 1; i < 17; i++) {
JLabel l = new JLabel(new ImageIcon("u"+i+".jpg"), JLabel.CENTER);
l.setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED));
panel.add(l);
}