Hello!
I am using BlueJ and having issues with this part of my code:
slideSize = new JSlider(JSlider.HORIZONTAL,1, 10, 5);
slider.setBorder(BorderFactory.createTitledBorder("Pressure Control"));
slider.setMinorTickSpacing(1);
slider.setPaintTicks(true);
slider.setPreferredSize( new Dimension( 500, 60 ) );
add(slider, BorderLayout.PAGE_END);
slider.addChangeListener(this);
Gives this compile error:
method addChangeListener in class javax.swing.Jslider cannot be applied to given types;
required: java .swing.event.ChangeListener
found:ExampleSoloution8_2
reason: actual argument ExampleSoloution8_2 cannot be converted to javax.swing.event.ChangeListener by method invocation conversion
The operator that you use here cannot be used for the type of value that you are using for it. You are either using the wring type here, or the wrong operator.
Any tips?
Thanks!