Please Comment Johan Painting Problems in Print Preview

Hi All

We have currently been experiencing some problems when print previewing forms with images and html contained within them.

When resizing the print preview windows, some of the elements simply appear and disappear randomly.

The form only has a body section and displays fine in smart client.
The behaviour is quite hard to describe so I have made a small video.
Could anyone comment on this.

Regards

print preview weirdness.zip (1.18 MB)

Could I possibly bump this,

Could anyone from Servoy comment?

We are really under the gun with this one now,

Some help from Servoy needed!!

did you file a bug/request in the support system?

Well to be honest,
I wanted some advice as to whether or not this IS a bug firstly and sshould i file a case??

hmm, indeed, this look more like java painting issue…
have you tried it other PC’s? different java version? like some older: java 1.5?

i can’t do much with a movie, please create a case with a sample solution.

We have this tested on 2 xp machines, 1 windows 7 machine.

We have also tried rolling back to java update 16.

With the same problems.

Also we have noticed, that if you open the page setup dialog,
and change from say mm to inches but not altering the size then close the dialog. Differnt areas of the form become visible/invisible.

Video of this is attached.

So do you suggest trying java 1.5?

more weirdness.zip (1.68 MB)

yes, try java 1.5 If I remember right, java 1.6 is totally different in rendering to screen.

I will try this and let you know how it goes

Thanks

Unfortunately this hasn’t helped,
I will submit a sample solution for review

Also a point to note is that we have different behaviour from developer and live application server.

In developer all the issues with missing parts of the form are present, however when running on the app server, nothing at all appears in the preview window, the form briefly flashes and then disappears.

Regards

Hi

I have found that the following error is being thrown when the painting problem occurs

Note that this is intermittent

java.lang.ArrayIndexOutOfBoundsException: 0 
    	at javax.swing.text.BoxView.getOffset(Unknown Source) 
    	at javax.swing.text.BoxView.paint(Unknown Source) 
    	at javax.swing.text.ParagraphView.paint(Unknown Source) 
    	at javax.swing.text.html.ParagraphView.paint(Unknown Source) 
    	at javax.swing.text.BoxView.paintChild(Unknown Source) 
    	at javax.swing.text.BoxView.paint(Unknown Source) 
    	at javax.swing.text.html.BlockView.paint(Unknown Source) 
    	at javax.swing.text.BoxView.paintChild(Unknown Source) 
    	at javax.swing.text.BoxView.paint(Unknown Source) 
    	at javax.swing.text.html.BlockView.paint(Unknown Source) 
    	at javax.swing.plaf.basic.BasicTextUI$RootView.paint(Unknown Source) 
    	at javax.swing.plaf.basic.BasicTextUI.paintSafely(Unknown Source) 
    	at javax.swing.plaf.basic.BasicTextUI.paint(Unknown Source) 
    	at javax.swing.plaf.basic.BasicTextUI.update(Unknown Source) 
    	at javax.swing.JComponent.paintComponent(Unknown Source) 
    	at javax.swing.JComponent.printComponent(Unknown Source) 
    	at javax.swing.JComponent.paint(Unknown Source) 
    	at com.servoy.j2db.smart.dataui.DataTextEditor$MyEditorPane.paint(DataTextEditor.java:654) 
    	at javax.swing.JComponent.print(Unknown Source) 
    	at com.servoy.j2db.smart.dataui.DataTextEditor$MyEditorPane.print(DataTextEditor.java:643) 
    	at javax.swing.JComponent.printAll(Unknown Source) 
    	at javax.swing.JComponent.paintChildren(Unknown Source) 
    	at javax.swing.JComponent.printChildren(Unknown Source) 
    	at javax.swing.JComponent.paint(Unknown Source) 
    	at javax.swing.JViewport.paint(Unknown Source) 
    	at javax.swing.JComponent.print(Unknown Source) 
    	at javax.swing.JComponent.printAll(Unknown Source) 
    	at javax.swing.JComponent.paintChildren(Unknown Source) 
    	at javax.swing.JComponent.printChildren(Unknown Source) 
    	at com.servoy.j2db.smart.dataui.DataTextEditor.printChildren(DataTextEditor.java:1687) 
    	at javax.swing.JComponent.paint(Unknown Source) 
    	at javax.swing.JComponent.print(Unknown Source) 
    	at javax.swing.JComponent.printAll(Unknown Source) 
    	at javax.swing.JComponent.paintChildren(Unknown Source) 
    	at com.servoy.j2db.smart.dataui.DataRenderer.paintChildren(DataRenderer.java:383) 
    	at javax.swing.JComponent.printChildren(Unknown Source) 
    	at javax.swing.JComponent.paint(Unknown Source) 
    	at javax.swing.JComponent.print(Unknown Source) 
    	at javax.swing.JComponent.printAll(Unknown Source) 
    	at com.servoy.j2db.printing.DataRendererDefinition.printAll(DataRendererDefinition.java:597) 
    	at com.servoy.j2db.printing.PageDefinition.render(PageDefinition.java:218) 
    	at com.servoy.j2db.printing.PageDefinition.printPage(PageDefinition.java:146) 
    	at com.servoy.j2db.printing.FormPreviewPanel.paintComponent(FormPreviewPanel.java:507) 
    	at javax.swing.JComponent.paint(Unknown Source) 
    	at javax.swing.JComponent.paintToOffscreen(Unknown Source) 
    	at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(Unknown Source) 
    	at javax.swing.RepaintManager$PaintManager.paint(Unknown Source) 
    	at javax.swing.RepaintManager.paint(Unknown Source) 
    	at javax.swing.JComponent._paintImmediately(Unknown Source) 
    	at javax.swing.JComponent.paintImmediately(Unknown Source) 
    	at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source) 
    	at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source) 
    	at com.servoy.j2db.util.gui.OverlapRepaintManager.paintDirtyRegions(OverlapRepaintManager.java:178) 
    	at javax.swing.RepaintManager.seqPaintDirtyRegions(Unknown Source) 
    	at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source) 
    	at java.awt.event.InvocationEvent.dispatch(Unknown Source) 
    	at java.awt.EventQueue.dispatchEvent(Unknown Source) 
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) 
    	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) 
    	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) 
    	at java.awt.Dialog$1.run(Unknown Source) 
    	at java.awt.Dialog$3.run(Unknown Source) 
    	at java.security.AccessController.doPrivileged(Native Method) 
    	at java.awt.Dialog.show(Unknown Source) 
    	at java.awt.Component.show(Unknown Source) 
    	at java.awt.Component.setVisible(Unknown Source) 
    	at java.awt.Window.setVisible(Unknown Source) 
    	at java.awt.Dialog.setVisible(Unknown Source) 
    	at com.servoy.j2db.util.JEscapeDialog.setVisible(JEscapeDialog.java:165) 
    	at com.servoy.j2db.FormDialog.setVisible(FormDialog.java:149) 
    	at com.servoy.j2db.smart.SwingFormManager.showFormInDialog(SwingFormManager.java:776) 
    	at com.servoy.j2db.scripting.JSApplication.js_showFormInDialog(JSApplication.java:1855) 
    	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 
    	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 
    	at java.lang.reflect.Method.invoke(Unknown Source) 
    	at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:179) 
    	at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:353) 
    	at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3666) 
    	at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2680) 
    	at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:166) 
    	at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:387) 
    	at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3127) 
    	at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:165) 
    	at com.servoy.j2db.scripting.ScriptEngine.executeFunction(ScriptEngine.java:458) 
    	at com.servoy.j2db.debug.RemoteDebugScriptEngine.executeFunction(RemoteDebugScriptEngine.java:382) 
    	at com.servoy.j2db.FormController.executeFunction(FormController.java:3970) 
    	at com.servoy.j2db.FormController.executeFunction(FormController.java:3858) 
    	at com.servoy.j2db.FormController.executeFunction(FormController.java:3780) 
    	at com.servoy.j2db.FormController$ScriptExecuter.executeFunction(FormController.java:3635) 
    	at com.servoy.j2db.ui.BaseEventExecutor.fireEventCommand(BaseEventExecutor.java:270) 
    	at com.servoy.j2db.ui.BaseEventExecutor.fireActionCommand(BaseEventExecutor.java:217) 
    	at com.servoy.j2db.smart.dataui.AbstractScriptLabel$5.mouseReleased(AbstractScriptLabel.java:1023) 
    	at java.awt.Component.processMouseEvent(Unknown Source) 
    	at javax.swing.JComponent.processMouseEvent(Unknown Source) 
    	at java.awt.Component.processEvent(Unknown Source) 
    	at java.awt.Container.processEvent(Unknown Source) 
    	at java.awt.Component.dispatchEventImpl(Unknown Source) 
    	at java.awt.Container.dispatchEventImpl(Unknown Source) 
    	at java.awt.Component.dispatchEvent(Unknown Source) 
    	at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) 
    	at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) 
    	at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) 
    	at java.awt.Container.dispatchEventImpl(Unknown Source) 
    	at java.awt.Window.dispatchEventImpl(Unknown Source) 
    	at java.awt.Component.dispatchEvent(Unknown Source) 
    	at java.awt.EventQueue.dispatchEvent(Unknown Source) 
    	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) 
    	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) 
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) 
    	at java.awt.EventDispatchThread.pumpEvents(Unknown Source) 
    	at java.awt.EventDispatchThread.pumpEvents(Unknown Source) 
    	at java.awt.EventDispatchThread.run(Unknown Source)

Any comments would be greatly appreciated

thats an error deep down in java itself.

Are you showing there somewhere html that is not completely correct?

Just before this error

We have an error, saying that we have invalid html in a global.
From the logs it looks as if the html has been duplicated, ie one table followed by another, however on application output of the global on the on show of the form,
it seems that the html is present and correct ie not duplicated.

The form is always showing the same data, so I cant understand why the problem is so intermittent, ie the five times I showed this form before the paint issue and error occurred, the form showed fine??

Confused!