Check out example codes for "java button with jpg image". It will help you in understanding the concepts better.

Code Example 1

JButton button; // precondition: not null
ImageIcon icon = new ImageIcon(FirstWindow.class.getResource("/Background.jpeg"));
button.setIcon(icon);
button.setDisabledIcon(icon); // or a grayed-out version

Learn ReactJs, React Native from akashmittal.com