I have been working on ImageJ and need to add scroll bars in a plugin: Weka_segmentation It implements java.awt.Frame to ij.gui.ImageWindow, which is implemented by a stackwindow class, which is in turn implemented by a customwindow class. I have to add scroll bars in this class. Is there any east, short way?
Asked
Active
Viewed 2,715 times
0
-
That code **imports** `java.awt.Frame` but actually **uses** a `javax.swing.JFrame` with Swing components. – Andrew Thompson Jul 02 '12 at 07:31
2 Answers
3
Try this....
JScrollPane scroll = new JScrollPane(Component);
Component here will signify the one which needs scrolling...

Kumar Vivek Mitra
- 33,294
- 6
- 48
- 75
-
1I think we should sort out whether Swing, AWT or a mixture is needed for this before jumping in with answers (that would create a mix of AWT & Swing). – Andrew Thompson Jul 02 '12 at 07:33
-
Ya thats absoultely right..... but i gave him a quick fix reply, that usually Works... , and it does ! But your point is absolutely right. – Kumar Vivek Mitra Jul 02 '12 at 07:42
-
thanks, but i can't get how to implement a scroll pane in the plugin, maybe you could take a look at the code, there's a customwindow class there that's used as the mane GUI pane – user636177 Jul 03 '12 at 05:14
-
Email the entire code on my email.. vivek.mitra786@gmail.com , i am at work now as soon as i get sometime i will implement it – Kumar Vivek Mitra Jul 03 '12 at 05:17
1
I'm the main developer of that plugin. Where do you want the scroll bars?
You may get a detailed answer if you write to the main Fiji developer list: https://groups.google.com/group/fiji-devel
ignacio