java button with jpg image

Solutions on MaxInterview for java button with jpg image by the best coders in the world

showing results for - "java button with jpg image"
Amelie
06 Feb 2019
1JButton button; // precondition: not null
2ImageIcon icon = new ImageIcon(FirstWindow.class.getResource("/Background.jpeg"));
3button.setIcon(icon);
4button.setDisabledIcon(icon); // or a grayed-out version