Closed mark-summerfield closed 4 years ago
The code calls a different constructor than the one accepting a StockID because the IconSize is missing. The value that is in the StockID enum is passed to the constructor expecting a filename.
This should work:
optionsButton = new Button("_Options");
optionsButton.setImage(new Image(StockID.PREFERENCES, IconSize.BUTTON));
That didn't work for me, but this variation did:
optionsButton.setImage(new Image(StockID.PREFERENCES,
IconSize.fromName("BUTTON")));
Using
Button.setImage
doesn't seem to work with stock item images. Attached is a tiny runnable example that shows a "missing icon" icon instead of the wanted icon. b1bug.zip