HI there, I am adding some functionalities to DrJava, which i will submit later because I am still learning how to do stuff on it.
I have been working on zooming in and zooming out the print preview. I managed to get it working. however, the preview will go beyond the screen so i added a scrollpane in order to keep the preview within the window frame.
I added the scrollpane and when i run it, the scroll pane will keep scrolling without stopping. I tried several way to fix it but i could not do it.
the following is the snippet of code that is modifed in previewframe.java
private JScrollPane _previewScroll;
JPanel tbCont = new JPanel(new BorderLayout());
JPanel cp = new JPanel(new BorderLayout());
_previewScroll = new JScrollPane(cp);
attached is a screenshot when the pane starts to scroll non stopping
It will be great if you provide me with hints on how to solve this problem
Log in to post a comment.