4 Replies Latest reply: Jul 14, 2011 12:21 PM by Narayan RSS

    Dragging applet from browser to desktop

    875392
      We have chosen JavaFX for a suite of tools formour customer. I have seen demos of JavaFX apps that allow the app to be dragged from the browser t the desktop and have that applet installed on the client machine. I have been unable to locate any code samples that demonstrate this functionality. Can anyone point me in the Robyn direction? Thanks!
        • 1. Re: Dragging applet from browser to desktop
          Narayan
          Hello user,
          To make the applet draggable to Desktop the below sample code is an example:(Make sure you have signed the jar files)
          Stage {
              title: "Application Test"
              scene: Scene {
                  width: 500
                  height: 500
                  content: [
                      Rectangle {
                              x: 10, y: 10
                              width: 140, height: 90
                              fill: Color.BLACK
                      }
                  ]
              }
              extensions : [ AppletStageExtension {
                      //define mouse state if cursor is in draggable region
                      shouldDragStart: function(e:javafx.scene.input.MouseEvent): Boolean {
                               return true;                    
                      }
          
                     /* onDragFinished: function(): Void  {
                          //here you can set state of stage
                      }
                      //set variable to indicate when applet is in the browser
                      onAppletRestored: function(): Void  {
                          //here you can set state of stage
                      }
                      */
                      useDefaultClose: true
              }]
          }
          API Reference: AppletStage Extension

          Thanks.
          Narayan G.
          • 2. Re: Dragging applet from browser to desktop
            875392
            Thank you!
            • 3. Re: Dragging applet from browser to desktop
              875392
              Is this same functionality available in JavaFX 2.0?
              • 4. Re: Dragging applet from browser to desktop
                Narayan
                No not yet. But soon it will I think.

                Thanks.
                Narayan