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;
ppc.add(_pagePreview);
JPanel tbCont = new JPanel(new BorderLayout());
JPanel cp = new JPanel(new BorderLayout());
_previewScroll = new JScrollPane(cp);
_previewScroll.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBA
R_AS_NEEDED);
_previewScroll.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS
_NEEDED);
tbCont.add(_toolBar,BorderLayout.NORTH);
tbCont.add(Box.createVerticalStrut(10),BorderLayout.SOUTH);
tbCont.setBorder(new EmptyBorder(0,0,5,0));
setContentPane(_previewScroll);
cp.setBorder(new EmptyBorder(5,5,5,5));
cp.add(tbCont, BorderLayout.NORTH);
cp.add(ppc, BorderLayout.SOUTH);
addWindowListener(_windowCloseListener);
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
thanks
Nobody/Anonymous
Other
None
Public
|
Date: 2009-11-20 23:03 Thanks for the information. That was of help to me and I managed to get the |
|
Date: 2009-11-14 05:22 I believe you need to modify PagePreviewContainer. If you look at |
| Filename | Description | Download |
|---|---|---|
| Screenshot.png | Download |
| Field | Old Value | Date | By |
|---|---|---|---|
| priority | 5 | 2009-11-20 23:03 | shuaib85 |
| File Added | 350660: Screenshot.png | 2009-11-12 22:33 | shuaib85 |
Copyright © 2010 Geeknet, Inc. All rights reserved. Terms of Use