Any idea how come i could not open my image into the JPanel?
This is the summary of the codes
JPanel rightPanel = new JPanel();
// method to load images from FileChooser
private void loadImages()
{
int returnVal = fc.showOpenDialog(convertImage.this);
if(returnVal == JFileChooser.APPROVE_OPTION)
{
if(fc.getSelectedFile() == null)
return;
File file = fc.getSelectedFile();
URL url = null;
try
{
url = file.toURL();
}
catch(MalformedURLException mue)
{
System.out.println(mue.getMessage());
}
JLabel label = new JLabel(new ImageIcon(url));
// adding the image to right panel
rightPanel.add(label, gbc);
// cannot find this method revalidate
revalidate();
repaint();
}
}


