Results 1 to 6 of 6

Thread: How to Develop a Draggable Applets?

  1. #1
    Join Date
    Aug 2006
    Posts
    300

    How to Develop a Draggable Applets?

    Hi friends,
    I have done lot of things in an Applets. Now I am told to do applet which can be dragged outside of the browser. I have never done such of type of things before. So thought that there might be someone who knows about this applet.!! Please help me by telling how to Develop a Draggable Applets? Please provide the coding so that I can use it.!!

  2. #2
    Join Date
    Mar 2008
    Posts
    349

    Re: How to Develop a Draggable Applets?

    I think that before using the draggable applets you should know about it, otherwise you will find tough while doing the coding. An applet that is deployed by specifying the draggable parameter can be dragged outside of the browser and dynamically transformed into a Java Web Start application. You can drag an applet by pressing the Alt key and the left mouse button and dragging the mouse. When you start doing the drag operation, the applet is removed from its parent container and placed in a new undecorated top-level window. Now in this the parent container are Applet or JApplet and the top-level window are Frame or JFrame.

  3. #3
    Join Date
    Mar 2008
    Posts
    672

    Re: How to Develop a Draggable Applets?

    After specifying the draggable parameter and when you drag the applet, a small floating Close button is displayed next to the dragged applet. The applet is placed back in the browser when you click the floating Close button. Since the applets can be dragged out of the browser, it is called as draggable applets. In the following way you can customize the behavior of a draggable applet :
    • You can add a desktop shortcut. This shortcut can be used to launch your application outside of the browser.
    • You can also change the keystroke and mouse button sequence that is used to drag the applet outside of the browser.
    • You can define how the applet should be closed after it has been dragged outside of the browser.

  4. #4
    Join Date
    Nov 2008
    Posts
    996

    Re: How to Develop a Draggable Applets?

    According to me you should be knowing much about the applets that can be dragged. You can enable the capability to drag an applet by setting the draggable parameter to true when deploying the applet. The following code demonstrates the same :
    Code:
    <script src="URL goes here"></script>
    <script> 
        var attributes = { code:'MenuChooserApplet', width:800, height:200 };
        var parameters = {jnlp_href: 'draggableapplet.jnlp', draggable: 'true'} ;
        deployJava.runApplet(attributes, parameters, '1.6');
    </script>

  5. #5
    Join Date
    Aug 2006
    Posts
    235

    Re: How to Develop a Draggable Applets?

    You can customize the applets accordingly. In that you can change the keystroke and mouse button sequence that is used to drag an applet by implementing the isAppletDragStart method. The applet can be dragged by pressing the left mouse button and dragging the mouse which is shown in the sample of coding :
    Code:
    public boolean isAppletDragStart(MouseEvent me) {
            if(me.getID() == MouseEvent.MOUSE_DRAGGED) {
                return true;
            } else {
                return false;
            }
        }
    3.2 (northwood)
    2gig ram
    ATI AIW X800xt 256mb
    Gigabyte GA-8knxp 875p Chipset
    Optiwrite 8X DVD Burner
    Win XP PRO Sp2 (Works Perfectly)
    2 SATA Raptor 74gig Raid 0
    2 7200 IDE 320gig HD

  6. #6
    Join Date
    Aug 2006
    Posts
    227

    Re: How to Develop a Draggable Applets?

    You can define how your applet can be closed. I have explained you with the following example in which MenuChooserApplet class receives the close listener and passes it on to the instance of the MenuItemChooser class :
    Code:
    MenuItemChooser display = null;
    ...
    show= new MenuItemChooser();
    ...
    public void setAppletCloseListener(ActionListener al) {
        show.setCloseListener(al);
    }
    
    public void appletRestored() {
        show.setCloseListener(null);
    }
    I do to dead flowers what people at morgues do to dead people. Suck all the moisture out, dip them in plastic, paint them up pretty and put them in a nice frame.

Similar Threads

  1. Logitech G19 Applets are missing
    By Micro-Dona in forum Hardware Peripherals
    Replies: 3
    Last Post: 22-05-2012, 03:38 PM
  2. Applets V/s Swing in JAVA
    By "Dritan" in forum Software Development
    Replies: 3
    Last Post: 14-12-2010, 09:04 AM
  3. How to use applets?
    By Gunner 1 in forum Software Development
    Replies: 5
    Last Post: 25-02-2010, 02:12 AM
  4. How to Communicate with other Applets?
    By PsYcHo 1 in forum Software Development
    Replies: 4
    Last Post: 18-02-2010, 04:17 AM
  5. How to Make Applets in Java?
    By NGV BalaKrishna in forum Software Development
    Replies: 4
    Last Post: 10-02-2010, 07:05 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,751,024,975.89291 seconds with 16 queries