hi all,
I am to make an Image viewer and I made so much on it but I faced a problem that I didn't know who to add scrollbars so that when the image is zoomed or is more than the size of the frame two horizntal and vertical scrollbar will apear. I couldn't do that!!. Here is a sample but watch it the file is not there you gotta but one and thhe frame is unclosable(u have to ctrl+alt+del and close it)
==============================================
import java.awt.*;
public class ScrollTheImage extends Frame{
Image im = Toolkit.getDefaultToolkit().getImage("anImage.gif"
//constructor
ScrollTheImage() {
super("Addola"
setSize(500,500);
show();
}
public void paint(Graphics g){
g.drawImage(im,50,50,this);
}
public static void main (String[]args){
new ScrollTheImage();
}
}
please find me the easiest way to make it possible.
regards,
Addola
I am to make an Image viewer and I made so much on it but I faced a problem that I didn't know who to add scrollbars so that when the image is zoomed or is more than the size of the frame two horizntal and vertical scrollbar will apear. I couldn't do that!!. Here is a sample but watch it the file is not there you gotta but one and thhe frame is unclosable(u have to ctrl+alt+del and close it)
==============================================
import java.awt.*;
public class ScrollTheImage extends Frame{
Image im = Toolkit.getDefaultToolkit().getImage("anImage.gif"
//constructor
ScrollTheImage() {
super("Addola"
setSize(500,500);
show();
}
public void paint(Graphics g){
g.drawImage(im,50,50,this);
}
public static void main (String[]args){
new ScrollTheImage();
}
}
please find me the easiest way to make it possible.
regards,
Addola