I\'ve got this code but IntelliJ tells me to replace anonymous with lambda but I don\'t know how. can anyone help me with this? Here is my code:
soundVolume.valu
It doesn't really help with the readability but here it is.
Note that main
's reference should be final or effectively final for this to work.
soundVolume.valueProperty()
.addListener(
(ObservableValue extends Number> ov, Number old_val, Number new_val) -> {
main.setSoundVolume(new_val.doubleValue());
main.getMediaPlayer().setVolume(main.getSoundVolume())
});