Skip to main content

Painting and Mouse event Issues with JDICplus 0.2.2

5 replies [Last post]
tdanecito
Offline
Joined: 2005-10-10
Points: 0

Since I have gotten 0.2.2 to work I have run into some issues and I am leaving what I have found in this new message thread so there is a single message thread for the JDICplus author to read when he has time.

1. It is a windows only XP, Vista(?) solution. Dll Link errors with Windows 200 Professional.

2. The author of the project states it is lightweight although I have experienced painting issues with 0.2.2. Specifically so far if you minimize then maximize JInternalFrames with the BrComponent (Browser) in the JInternalFrame that is at the top of the Z-order will have it's window painted over by the next JinternalFrame that is under it that has a BrComponent. I also noticed the painting issue occurs if you move the mouse over part of the lower level window with the browser that has a html page displayed in it and move the mouse over a tab in the html there is a repaint that then occurs for the tab that ovewrites the JinternalFrame contents above it.

3. If you add a mouse listener to the BrComponent it works oddly. If you have a print statement in the mouseReleased method of the mouselistener that was added to the BrComponent for example that event only gets sent the first time you put focus on the window and press then release the mouse button. Subsequent mouse button press/releases do not generate those events to the mouse listener.

I hope that helps others.

Regards,
-Tony

Message was edited by: tdanecito

Message was edited by: tdanecito

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
ffo
Offline
Joined: 2004-12-30
Points: 0

I am not sure if we have the same problem but here is the workarround I found:

override paintComponent(Graphics g) of the brComponent container with:

super.paintComponent(g);
brComponent.repaint();
It "flashes" the first time but then the content is correct.

Otherwise it might be another issue for which I found a workarround: BrComponents in tabbedpanes. the BrComponents should be explicitely setVisible(false) when the tab is deselected. otherwise is messes up the new displayed tab.

tdanecito
Offline
Joined: 2005-10-10
Points: 0

Hi ffo,

I will look into what you mentioned.

I also ran into another interesting paint issue where if I had two JInternalFrame window each with say a web cam in it only one gets updated the other JInternalFrame cam either shows black or updates maybe once if I position the mouse over that part of the html that has the cam.

Regards,
-Tony

tdanecito
Offline
Joined: 2005-10-10
Points: 0

Hi uta,

Here are the dll errors under windows 2000 prof.

Thanks,
-Tony
java.lang.UnsatisfiedLinkError: C:\Documents and Settings\Administrator\Application Data\Sun\Java\Deployment\cache\6.0\23\47899057-297e8e8e-n\jdicWeb.dll: The specified procedure could not be found

at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at org.jdic.NativeLoadMgr.loadLibrary(NativeLoadMgr.java:101)
at org.jdic.web.peer.WBrComponentPeer.onAddNotify(WBrComponentPeer.java:534)
at org.jdic.web.BrComponent.addNotify(BrComponent.java:463)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addImpl(Unknown Source)
at java.awt.Container.add(Unknown Source)
at Jlib.GenericControl.Control$3.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at Jlib.GenericUtil.GlobalHotKeyManager.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)
Exception in thread "AWT-EventQueue-2" java.lang.UnsatisfiedLinkError: org.jdic.web.peer.WBrComponentPeer.initIDs()V
at org.jdic.web.peer.WBrComponentPeer.initIDs(Native Method)
at org.jdic.web.peer.WBrComponentPeer.onAddNotify(WBrComponentPeer.java:536)
at org.jdic.web.BrComponent.addNotify(BrComponent.java:463)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addImpl(Unknown Source)
at java.awt.Container.add(Unknown Source)
at Jlib.GenericControl.Control$3.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at Jlib.GenericUtil.GlobalHotKeyManager.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)

Message was edited by: tdanecito

uta
Offline
Joined: 2007-01-10
Points: 0

1. That kind of Dll Link errors do you have?

2. The paint procedure is very tricky and depends strongly from chosen paint approach
(PAINT_JAVA, PAINT_JAVA_NATIVE, PAINT_NATIVE)

3. Mouse listener to the BrComponent shouldn't work at all. Please use Javascript injection. Find the example with keyboard events support in forum and make necessary changes.

tdanecito
Offline
Joined: 2005-10-10
Points: 0

Hi uta,

Thanks for the reply. I tried different options such as you suggested and I did get better results for one of them where at least for two windows using java.net for the url did not casue a painting issue. I did notice if I had one JinternalFrame java.net and the other yahoo.com under it that moving the mouse over the yahoo.com cause it's html content to show up above the java.net.

I did get through some of the painting issue by using reshape so when I moved a window and it stopped moving I did a setBounds on the JInternalFrame I moved and it removed the issue where the contents of the moved JInternalFrame were still painted properly but if you went down to the area where that window was moving the mouse caused the links on the moved window to get highlighted. Really interesting issue but I found a hack.

I got JDICplus source code to work in Eclipse and I am going to focus on the remaining issue. It would be great if we could disable painting for the other JInternalFrames but then it would get trickier for the use case when there are two JInternalFrames side by side and you wanted to painting to continue.

I did do another hack for the mouse by using propertychange events. I did pick up the viewCenter event for BrMap and used that instead. Problem with that is it generates the event but in order to get the correct value for the center I had to wait till the next mouse move then for some reason the call to get the view center is correct.

I hope that helps you uta. I am trying to find out the issue for the last painting problem I am working on. The BrMap issues took some time away from the painting ones.

All in All I am quite pleased with what you have accomplished!!!

Regards,
Tony Anecito
Founder,
MyUniPortal
http://www.myuniportal.com