I'm studying at the moment and I've been given the simple (I thought so) task. I have to make this piece of code to work (I can't modify it):
JButton b = new JButton("Myszą ciśnij");
b.addMouseListener ( (MousePressListener) e -> System.out.println("ok"));
I believe MousePressListener should be FunctionalInterface but then, it can't extend MouseListener. Is there any way to work around this issue, or am I approaching it from bad side?