Overblog
Suivre ce blog
Editer l'article Administration Créer mon blog
9 janvier 2007 2 09 /01 /janvier /2007 18:48

Purpose

Here is a Java bean that allows to Drag 'n Drop between Forms items.

Drag 'n Drop

You can Drag 'n Drop between mono and multi-line text fields and between images.

Because the "real Java" Drag 'n Drop is not implemented in the Forms application, This one is "hand made".
So when you release the mouse button to drop the object, you have to move the mouse about one pixel to
really drop the object.

Press the Ctrl keybord key if you want to keep the original object (COPY).

This demo load the image from the c:/wile.jpg image file, so copy this file from the zip file to your c:/ directory.


The Java code

     DnD.java



The implementation class of the Bean Item

     oracle.forms.fd.DnD




The sample dialog

     . Download the DnD.zip file

     . Unzip the file
     . copy the DnD.jar file in the <ORACLE_HOME>/forms/java directory

     . Edit your /forms/server/formsweb.cfg file to add this jar file
     . Open the DnD.fmb module (Oracle Forms 9.0.2)
     . Compile all and run the module

Partager cet article

Published by Oracle Forms community - dans Bean - general
commenter cet article

commentaires

user123 03/06/2011 05:55



heyy franc this is what is diaplyed in the java console


 


Oracle JInitiator: Version 1.3.1.22
Using JRE version 1.3.1.22-internal Java HotSpot(TM) Client VM
User home directory = C:UsersITD

Proxy Configuration: no proxy

JAR cache enabled
     Location: C:UsersITDOracle Jar Cache
     Maximum size: 50 MB
     Compression level: 0



----------------------------------------------------
c:   clear console window
f:   finalize objects on finalization queue
g:   garbage collect
h:   display this help message
l:   dump classloader list
m:   print memory usage
q:   hide console
s:   dump system properties
t:   dump thread list
x:   clear classloader cache
0-5: set trace level to
----------------------------------------------------

Loading http://itd-pc04:8889/forms/java/frmall_jinit.jar from JAR cache

Loading http://itd-pc04:8889/forms/java/frmwebutil.jar from JAR cache

Loading http://itd-pc04:8889/forms/java/jacob.jar from JAR cache

Loading http://itd-pc04:8889/forms/java/frite_v0.1.jar from JAR cache

Loading http://itd-pc04:8889/forms/java/FormsGraph.jar from JAR cache

Loading http://itd-pc04:8889/forms/java/htmlpane.jar from JAR cache

Loading http://itd-pc04:8889/forms/java/DnD.jar from JAR cache

proxyHost=null

proxyPort=0

connectMode=HTTP, native.

Forms Applet version is : 10.1.2.0

BI Beans Graph version [null] Engine version [null]

proxyHost=null

proxyPort=0

connectMode=HTTP, native.

Forms Applet version is : 10.1.2.0

BI Beans Graph version [null] Engine version [null]

BI Beans Graph version [null] Engine version [null]

BI Beans Graph version [null] Engine version [null]

BI Beans Graph version [null] Engine version [null]

BI Beans Graph version [null] Engine version [null]

oracle.dss.util.RowOutOfRangeException: BIB-2013 Row -3 exceeds boundary 4

    at oracle.dss.graph.LocalXMLDataSource.getValue(LocalXMLDataSource.java:362)

    at oracle.forms.demos.bigraph.mViewMouseListener.mouseClicked(mViewMouseListener.java:103)

    at oracle.dss.dataView.ControllerAdapter.processViewMouseEvent(ControllerAdapter.java:447)

    at oracle.dss.graph.GraphControllerAdapter._mouseClicked(GraphControllerAdapter.java:198)

    at oracle.dss.graph.GraphControllerAdapter.perspectiveEvent(GraphControllerAdapter.java:819)

    at tdg.event.TDGEventManager.notifyPerspectiveListener(TDGEventManager.java:94)

    at tdg.Perspective.TDGMouseClicked(Perspective.java:6632)

    at tdg.Perspective.mouseClicked(Perspective.java:6564)

    at java.awt.Component.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 oracle.ewt.event.tracking.GlassMouseGrabProvider$Disp._redispatchEvent(Unknown Source)

    at oracle.ewt.event.tracking.GlassMouseGrabProvider$Disp.mouseClicked(Unknown Source)

    at java.awt.Component.processMouseEvent(Unknown Source)

    at oracle.ewt.lwAWT.LWComponent.processMouseEvent(Unknown Source)

    at java.awt.Component.processEvent(Unknown Source)

    at java.awt.Container.processEvent(Unknown Source)

    at oracle.ewt.lwAWT.LWComponent.processEventImpl(Unknown Source)

    at oracle.ewt.event.tracking.GlassMouseGrabProvider$Proxy.processEventImpl(Unknown Source)

    at oracle.ewt.lwAWT.LWComponent.redispatchEvent(Unknown Source)

    at oracle.ewt.lwAWT.LWComponent.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.Component.dispatchEvent(Unknown Source)

    at java.awt.EventQueue.dispatchEvent(Unknown Source)

    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)

    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)

    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

    at java.awt.EventDispatchThread.run(Unknown Source)

oracle.dss.util.RowOutOfRangeException: BIB-2013 Row -3 exceeds boundary 4

    at oracle.dss.graph.LocalXMLDataSource.getValue(LocalXMLDataSource.java:362)

    at oracle.forms.demos.bigraph.mViewMouseListener.mouseClicked(mViewMouseListener.java:103)

    at oracle.dss.dataView.ControllerAdapter.processViewMouseEvent(ControllerAdapter.java:447)

    at oracle.dss.graph.GraphControllerAdapter._mouseClicked(GraphControllerAdapter.java:198)

    at oracle.dss.graph.GraphControllerAdapter.perspectiveEvent(GraphControllerAdapter.java:819)

    at tdg.event.TDGEventManager.notifyPerspectiveListener(TDGEventManager.java:94)

    at tdg.Perspective.TDGMouseClicked(Perspective.java:6632)

    at tdg.Perspective.mouseClicked(Perspective.java:6564)

    at java.awt.Component.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 oracle.ewt.event.tracking.GlassMouseGrabProvider$Disp._redispatchEvent(Unknown Source)

    at oracle.ewt.event.tracking.GlassMouseGrabProvider$Disp.mouseClicked(Unknown Source)

    at java.awt.Component.processMouseEvent(Unknown Source)

    at oracle.ewt.lwAWT.LWComponent.processMouseEvent(Unknown Source)

    at java.awt.Component.processEvent(Unknown Source)

    at java.awt.Container.processEvent(Unknown Source)

    at oracle.ewt.lwAWT.LWComponent.processEventImpl(Unknown Source)

    at oracle.ewt.event.tracking.GlassMouseGrabProvider$Proxy.processEventImpl(Unknown Source)

    at oracle.ewt.lwAWT.LWComponent.redispatchEvent(Unknown Source)

    at oracle.ewt.lwAWT.LWComponent.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.Component.dispatchEvent(Unknown Source)

    at java.awt.EventQueue.dispatchEvent(Unknown Source)

    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)

    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)

    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)

    at java.awt.EventDispatchThread.run(Unknown Source)

proxyHost=null

proxyPort=0

connectMode=HTTP, native.

Forms Applet version is : 10.1.2.0

BI Beans Graph version [null] Engine version [null]

BI Beans Graph version [null] Engine version [null]

BI Beans Graph version [null] Engine version [null]

BI Beans Graph version [null] Engine version [null]

BI Beans Graph version [null] Engine version [null]





Oracle Forms community 03/06/2011 07:06



This error seems to be raised by the BIGraph bean. Nothing to do with the Drag&Drop Java Bean



user123 02/06/2011 10:32



Hey franck when i run the form iam getting general exception.pls help



Oracle Forms community 02/06/2011 10:35



I can do nothing with your information. The first thing to do when you deal with Java Beans, is to see the Java Console content at runtime.



Hugo 01/04/2011 10:49



It's somehow better, because now the form shows up. But the Drag'n'Drop isn't working. I have this error now in the console:


java.lang.ClassNotFoundException: oracle.forms.fd.DnD
    at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass0(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
    at sun.plugin2.applet.Plugin2ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Unknown Source)
    at oracle.forms.handler.UICommon.instantiate(Unknown Source)
    at oracle.forms.handler.UICommon.onCreate(Unknown Source)
    at oracle.forms.handler.JavaContainer.onCreate(Unknown Source)
    at oracle.forms.engine.Runform.onCreateHandler(Unknown Source)
    at oracle.forms.engine.Runform.processMessage(Unknown Source)
    at oracle.forms.engine.Runform.processSet(Unknown Source)
    at oracle.forms.engine.Runform.onMessageReal(Unknown Source)
    at oracle.forms.engine.Runform.onMessage(Unknown Source)
    at oracle.forms.engine.Runform.sendInitialMessage(Unknown Source)
    at oracle.forms.engine.Runform.startRunform(Unknown Source)
    at oracle.forms.engine.Main.createRunform(Unknown Source)
    at oracle.forms.engine.Main.start(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)



Oracle Forms community 01/04/2011 19:02



This means that the bean is not loaded. Check that you have copied DnD.jar in your /forms/java folder, then added its name to your archive and archive_jini tags
of the /forms/server/formsweb.cfg file.



Hugo 31/03/2011 19:30



The error is:


Exception in thread "thread applet-oracle.forms.engine.Main-3" java.lang.NoSuchMethodError: oracle.forms.handler.IHandler.getApplet()Ljava/applet/Applet;
    at oracle.forms.fd.DnD.init(DnD.java:40)
    at oracle.forms.handler.UICommon.instantiate(Unknown Source)
    at oracle.forms.handler.UICommon.onCreate(Unknown Source)
    at oracle.forms.handler.JavaContainer.onCreate(Unknown Source)
    at oracle.forms.engine.Runform.onCreateHandler(Unknown Source)
    at oracle.forms.engine.Runform.processMessage(Unknown Source)
    at oracle.forms.engine.Runform.processSet(Unknown Source)
    at oracle.forms.engine.Runform.onMessageReal(Unknown Source)
    at oracle.forms.engine.Runform.onMessage(Unknown Source)
    at oracle.forms.engine.Runform.sendInitialMessage(Unknown Source)
    at oracle.forms.engine.Runform.startRunform(Unknown Source)
    at oracle.forms.engine.Main.createRunform(Unknown Source)
    at oracle.forms.engine.Main.start(Unknown Source)
    at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)




Oracle Forms community 01/04/2011 07:30



I have uploaded a new DnD.zip on the site. download it to extract the new DnD.jar, then try this new JAR.



Hugo 31/03/2011 16:45



I'm trying to use your jar in 11g. I have now Java 6 update 24. Although i add your jar to archive, and it get's downloaded, the form just don't display. There's an error on Java console. Any
idea how to overcome this?



Oracle Forms community 31/03/2011 19:18



"...There's an error..."


And you expect me to guess what the error is ?