try {
addImage(bodyPanel1, "https://sneakernews.com/wp-content/uploads/2020/10/jordan-1-black-mocha-555088-105-2.jpg");
} catch (MalformedURLException e) {
e.printStackTrace();
}
private void addImage(JPanel cp, String url) throws MalformedURLException{
cp.add(new JLabel(new ImageIcon(new URL(url))));
}
So I am trying to insert the image using a URL and then have it resize to the size of the bodypanel but whenever i try to run it the image doesnt scale itself. I have the entire bodypanel in a grid layout (3 row, 2 columns) and want to add an image to fit the entire size of one of the grid boxes. image