Hi All,
I have this problem, i have an object "ImageCanvas" extending JComponent on which i can set a jpeg image..this is a class provided by java itself. Now i have set this component as the view for a JScrollPane. The problem is that even though i have set the size for the viewport to be that of the imagecanvas object the viewport takes more size than the one i have specified and the scroll bars also are acting real strange.. i move one scrollbar and the other one also moves randomly..
Can anyone tell me what is going on.
I have used this piece of code...
String filepath = <path of my jpeg file>;
PlanarImage myimage = JAI.create("fileload",filepath);
ImageCanvas imageCanvas = new ImageCanvas(myimage);
JScrollPane scr = new JScrollPane();
scr.getViewport().add(imageCanvas);
Any help would be glady appreciated.
Thanx in advance,
Reddy316
I have this problem, i have an object "ImageCanvas" extending JComponent on which i can set a jpeg image..this is a class provided by java itself. Now i have set this component as the view for a JScrollPane. The problem is that even though i have set the size for the viewport to be that of the imagecanvas object the viewport takes more size than the one i have specified and the scroll bars also are acting real strange.. i move one scrollbar and the other one also moves randomly..
Can anyone tell me what is going on.
I have used this piece of code...
String filepath = <path of my jpeg file>;
PlanarImage myimage = JAI.create("fileload",filepath);
ImageCanvas imageCanvas = new ImageCanvas(myimage);
JScrollPane scr = new JScrollPane();
scr.getViewport().add(imageCanvas);
Any help would be glady appreciated.
Thanx in advance,
Reddy316