JScrollPane & the Component

Hi,

I’m using the JScrollPane-bean but if I add a tab-panell (with in a table-view form)as Component to the viewport of my ScrollPane then something wrong.

elements.myScrollPane.viewport.add(elements.myTabPanel)

In first if I do this I watch the tabpanel and its content clearly,then I can scroll up/down and left rigth with ScrollPane-Scrollbar or by an external JSScrollbar but if I try to
change a field-value of my table-view form then the client go in freezing and I have to kill it by TaskManager.

Can someone tell me what’s happened and how can I solve this mistake?

Thanks in advance

Marco
[attachment=0]test.servoy[/attachment]

EDIT:
This is a sample solution (work with Servoy 5.0.0 build 589)
Before that the tabpanel is added to the bean than work fine(you can click on the record).
If you press the button,the tabpanel will be added to the JSScrollPane and scroll fine.
If you try to click on the tabpanel into the bean than the client go freezing

test.servoy (6.85 KB)

Hi Marco,

I’m not 100% sure but I believe that the freeze is coming from a propertyChange event called from the tabPanel that is triggerring a wrong action in the JScrollPane, anyway that’s what my Thread dumps seems to indicate.
In any case, an easy workaround is to wrap your tabPanel inside a JPanel before setting the viewPort of the JScrollPane to it.

Suppose that you have a JPanel named “bean_panel” (make sure you set its anchor to TOP,RIGHT,BOTTOM,LEFT) on your form (you could also create it from code if you prefer), a JScrollPane named “bean_scrollpane” and a tabPanel “tabs_my” as in your example.
Then the workaround code would be:

	elements.bean_panel.setLayout(new java.awt.BorderLayout());
	elements.bean_panel.add(elements.tabs_my, java.awt.BorderLayout.CENTER,0);
	elements.bean_scrollpane.setViewportView(elements.bean_panel);
	elements.bean_scrollpane.invalidate();

Hope this helps,

All work fine now! :D
Thanks for your precius time!

Marco