Click to See Complete Forum and Search --> : Zooming image


moola
September 29th, 2006, 06:03 PM
I created a Jslider with certain values now I want those values to correspond and change my imageIcon size evertime i move it. THe icon is inserted into a JLabel and the JLabel inserted into a JPanel.


anIcon.setImage(rightIcon.getImage().getScaledInstance(100, 100, 100));


Now I want those 100 values to change, for example
private int getValue(){} to be replaced in there place.
I know I have to write a public void stateChanged(ChangeEvent ev) {
I have taht working cuz everytime I move the slider it system.out.println updates the new numbers for me.

Do I need to add a listener of some sort to the imageIcon or image? and
How do I go about zooming in an out?
Thanks