Public void drop(DropTargetDropEvent e)

This method won't executed, can someone give me some ideas what the problem could be or when normaly this method gets called ?
After the following (simplified) method is called nothing happens.
public void dragOver(DropTargetDragEvent e)
e.acceptDrag(DnDConstants.ACTION_COPY_OR_MOVE );
How usually the void drop(DropTargetDropEvent e) method gets executetd ?
thanks for answers...

Ensure that you have initialised a DropTarget
and implemented the DropTargetListener

Similar Messages

  • JTree DnD Problem - public void drop(DropTargetDropEvent e)

    This method won't executed, can someone give me some ideas what the problem could be.
    After the following (simplified) method is called nothing happens.
    public void dragOver(DropTargetDragEvent e)
    e.acceptDrag(DnDConstants.ACTION_COPY_OR_MOVE );
    How usually the void drop(DropTargetDropEvent e) method gets executetd ?
    thanks for answers...

    Ensure that you have initialised a DropTarget
    and implemented the DropTargetListener

  • Difference between public void, private void and public string

    Hi everyone,
    My 1st question is how do you know when to use public void, private void and public string? I am mightily cofuse with this.
    2ndly, Can anybody explain to me on following code snippet:
    Traceback B0;//the starting point  of Traceback
    // Traceback objects
    abstract class Traceback {
      int i, j;                     // absolute coordinates
    // Traceback2 objects for simple gap costs
    class Traceback2 extends Traceback {
      public Traceback2(int i, int j)
      { this.i = i; this.j = j; }
    }And using the code above is the following allowed:
    B[0] = new Traceback2(i-1, 0);
    Any replies much appreciated. Thank you.

    1)
    public and private are access modifiers,
    void and String return type declarations.
    2)
    It's called "inheritance", and "bad design" as well.
    You should read the tutorials, you know?

  • Difference between Public Void and Public Int

    I was wondering what the difference was between 'public void' and 'public int'?

    Yeah,
    Given package forumTest;
    public class ReturnVoid
         public int returnInt()
         public void returnVoid()
    }compiling using the 1.4.2 reference compiler produces the following result:
    $ javac -d classes/ src/forumTest/ReturnVoid.java
    src/forumTest/ReturnVoid.java:6: missing return statement
            ^
    1 error

  • Public void actionPerformed(ActionEvent e)

    public void actionPerformed(ActionEvent e)
            if(e.equals("north"))
                e.getSource().getClass(CLI);
        } hi i have a class called CLI which handles all the methods. i am reating a gui. i have created the buttons and layout and added actionlisteners to them. i am having trouble assigning the method north() whic is of type static void to the button.
    bassically when the button "north" is pressed i want to call the method North. i have been recommened to use the getSource() method from
    import java.util.EventObject;
    any ideas on where im going wrong?

    Forget getSource, assign a separate anonymous ActionListener to each button, that way when actionPerformed is called you already know which button was pressed.
    All you need to do (if you've put a handler method private void north() into your main class) is:
    northButton.addActionListener(new ActionListener() {
       public void actionPerformed(ActionEvent e)  {
             north();
      });(And, obviously, similarly for other buttons).
    This creates an instance of an anonymous inner class and connects the button to it so that the actionPerformed method is called when the button is pressed. That, in turn, calls north(); Because it's an inner class it can use the methods of the class it's contained in.

  • I want to know when the method "public void setName" is invoked?

    The jsp file contain the one which list below:
    <mt:hello name="foo"/>
    package com.acme.tag;
    import javax.servlet.jsp.*;
    import javax.servlet.jsp.tagext.*;
    public class HelloTag extends TagSupport
    private String name="";
    public HelloTag()
    super();
    � public void setName(String name) �
    � {                                                                    �
    � this.name=name; �
    � } �
    �_____________________________________________�
    public int doEndTag() throws javax.servlet.jsp.JspTagException
    try
    pageContext.getOut().write("Hello "+name+"!");
    catch(java.io.IOException e)
    throw new JspTagException("IO Error: " + e.getMessage());
    return EVAL_PAGE;
    }

    does the other method like :
    <b>public void setPageContext(PageContext PageContext)</b>
    and
    <b>public javax.servlet.jsp.tagext.Tag getParent()</b>
    is invoked like setName list above.
    Thanks!

  • How can i call the public void paint(Graphics g) method on click of button?

    Hello,
    I have done this before i know its got to do something with the repaint() method but can someone show me with and example and call the paint method using AWT in a frame not in an applet....
    Thank you very much.

    Thank You very Much.... You have cleared all my doubts.
    But my main objective is to display an image in an AWT Frame !!
    here is the code that i have been trying..
    import java.awt.*;
    import java.awt.event.*;
    public class check6 extends Panel
         Frame f;
         Image i;
         public check6()
              f = new Frame("Heading");
              f.addWindowListener(new WindowAdapter(){
                   public void windowClosing(WindowEvent e){
                        System.exit(0);
              final Button b1 = new Button("Submit");
              b1.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e){
                        repaint();
              i = getImage(getCodeBase(), "titanic.jpg");
              add(b1);
              setLayout(new FlowLayout(FlowLayout.LEFT));
              f.add(this);
              f.setSize(500,500);
              f.setVisible(true);
         public void paint(Graphics g)
              g.drawImage(i,10,10,this);
         public static void main(String args[])
              new check6();
    }

  • Question about public void characters(char []ch, int start, int length) thr

    Can anyone tell me how you would keep all the characters from within one pair of tags together each time characters() is called?
    the character() method doesn't read all the character data at once, and i would like to create a buffer of what it has read.
    thank you.

    I recommend using getNodeName and/or/combination
    with
    getNodeValue to get the strings.i have tried using a buffer, and i have got that to work!
    At long last I am seeing the string I would like to see as it is in the xml file!
    thank you for your help
    here is an example of my code:
    private boolean isDescription = false;
    StringBuffer sb = new StringBuffer();
    public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException {
         if(localName.equals("description")) {
              sb = new StringBuffer();
              isDescription = true;
    public void characters(char []ch, int start, int length) throws SAXException {
         if(isDescription == true) {
              String desc = new String(ch, start, length);
              sb.append(desc);
    public void endElement(String namespaceURI, String localName, String qName) throws SAXException {
         if(localName.equals("description")) {
              isDescription == false;
              System.out.println(sb.toString());
    }

  • RMI: swing: class ot interface expeted : public void

    PLease take look at the program and the error, i have underlined the area where error has occured...
    Thnk you
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.rmi.*;
    import java.net.*;
         public class appRMIcc extends Frame implements ActionListener{
               JLabel l;
               JTextField tf1,tf2;
               JButton b;
                    public appRMIcc(){
                         setLayout(new FlowLayout());
                         l = new JLabel("Enter the Credit Card number");
                         tf1 = new JTextField(30);
                         tf2 = new JTextField(30);
                         b = new JButton("Check the Card Number");
                         add(l);add(tf1);add(b);
                         add(tf2);
                         b.addActionListener(this);
                         public void actionPerformed(ActionEvent e){                          String cc = tf1.getText();
                              try{
                                   RMIccinterface robj;
                                   robj = (RMIccinterface) Naming.lookup("rmi://127.0.0.1/visagold");
                                   if(robj.isValid(cc)) tf2.setText(String.valueOf("Credit Card valid"));
                                   else
                                   tf2.setText(String.valueOf("Invalid Credit Card Number"));
                                   catch(Exception ex){
                                        System.out.println(ex);
               public static void main(String v[]){
                    appRMIcc dd = new appRMIcc();
                    dd.setSize(400,400);
                    dd.show();
    i got the following error, i ra the above program in the command line, it worked fine but applet is not working..
    --------------------Configuration: <Default>--------------------
    C:\j2sdk\bin\appRMIcc.java:28: 'class' or 'interface' expected
                                    public void actionPerformed(ActionEvent e){
                                           ^
    1 error
    Process completed.
         

    public appRMIcc(){
      setLayout(new FlowLayout());
      l = new JLabel("Enter the Credit Card number");
      tf1 = new JTextField(30);
      tf2 = new JTextField(30);
      b = new JButton("Check the Card Number");
      add(l);add(tf1);add(b);
      add(tf2);
      b.addActionListener(this);
    }If you say so...

  • Public void movePlayer

    I cant figure out what to write for my switch statement on this assignment,
    (25 spaced board game with 2 players, each taking turns rolling a die untill someone reaches 25)
    my method parameters for the movePlayer method are sapposed to be which player, (player1 or player2), moves as well as how many spaces out of 6 (rolled on the die). i am also sapposed to check if a winner can be identified in case 1 and case 2.
    i thought i was getting the hang of this but on this i'm at a total loss for ideas of how to do it,
    anyone have suggestions?
    public class GameBoard
            public static final int BOARD_LENGTH = 25;
         private int player1;
         private int player2;
         private int winner;
    public GameBoard(int player1State, int player2State)
              player1 = 0;
              player2 = 0;
              winner = 0;
              player1 = player1State;
              player2 = player2State;
    int player1State;
    int player2State;
    public int getBoardLength()
              return BOARD_LENGTH;
    public int getPlayer1State()
              return player1State;
    public int getPlayer2State()
              return player2State;
    int getWinner()
              return winner;
    public void resetBoard(int player1State, int player2State, int winner)
              player1State = 0;
              player2State = 0;
              winner = 0;
             // This method moves the specified player along
         // the game board a specified number of spaces.
         public void movePlayer( int spacesMoved, int playerMoved)
                 int spacesMoved;
                 int playerMoved;
              switch( playerMoved )
                   case 1:
                        // Your code goes here.
                   case 2:
                        // Your code goes here.
                   default:
                        System.out.println("Warning: Player " +  //Fill this in//
                                            + " does not exist!");
    }

    public class GameBoard
            public static final int BOARD_LENGTH = 25;
         private int player1;
         private int player2;
         private int winner;
    public GameBoard(int player1State, int player2State)
              player1 = 0;  // pointless! you reset its value 3 lines below
              player2 = 0;  // ditto
              winner = 0;
              player1 = player1State;
              player2 = player2State;
    int player1State;  // why do  you need a player1 variable as well as this one?
    int player2State;  // ditto
    public int getBoardLength()
              return BOARD_LENGTH;
    public int getPlayer1State()
              return player1State;
    public int getPlayer2State()
              return player2State;
    int getWinner()
              return winner;
    public void resetBoard(int player1State, int player2State, int winner)
              player1State = 0;
              player2State = 0;
              winner = 0;
             // This method moves the specified player along
         // the game board a specified number of spaces.
         public void movePlayer( int spacesMoved, int playerMoved)
                 int spacesMoved;  // pointless! You have a parameter with same name
                 int playerMoved;  // ditto
              switch( playerMoved )
                   case 1:
                        // Your code goes here.
                                   // presumably it is player1's turn so increase the player1 variable by number of spaces
                   case 2:
                        // Your code goes here.
                                    // ditto but for player2
                   default:
                        System.out.println("Warning: Player " +  //Fill this in//
                                            + " does not exist!");
    }See comments.

  • Public void init() {

    public void init() {
    imgMap = getImage(getCodeBase(), ("cardiff3.jpg"));
    }//init
    when i load this image in an applet over the net the downloaded parts of the image only become visible when i click the mouse(mouseClicked() happens to call repaint().
    how can i get the image to load without having to click the mouse all the time. is there an automatic way of calling repaint() repeatedly?

    just a thought...
    public void init() {
    imgMap = getImage(getCodeBase(), ("cardiff3.jpg"));
    if (imgMap != null){
    repaint();
    }//init

  • Strange Permissions Behavior with Public/Private Drop Box

    Strange Permissions Behavior with Non-Course Drop Box
    In an effort to promote iTunes U on campus this semester (and to get people working with audio and video more) we're having a contest in which people can submit personal or group audio/video projects.
    This being an iTunes promo, we intend for students to submit their contributions via a drop box.
    To that end, I began experimenting with drop boxes in iTunes U, which I haven't done much of previously. I've created a course called "iTunes U Drop Box Test" under "Campus Events". Within that, I have two tabs: "Featured Submissions" and "Dropbox". My goal with this drop box was to allow faculty, students and college folks the ability to use the drop box ("college" being a role I've defined for those who don't fit into the faculty/student roles).
    When I first started experimenting, access to the "iTunes U Drop Box Test" course looked like this:
    --- Credentials (System) ---
    Edit: Administrator@urn:mace:itunesu.com:sites:lafayette.edu
    Download: Authenticated@urn:mace:itunesu.com:sites:lafayette.edu
    Download: Unauthenticated@urn:mace:itunesu.com:sites:lafayette.edu
    Download: All@urn:mace:itunesu.com:sites:lafayette.edu
    --- Credentials ----
    Download: College@urn:mace:lafayette.edu
    Download: Instructor@urn:mace:lafayette.edu
    Download: Instructor@urn:mace:lafayette.edu:classes:${IDENTIFIER}
    Download: Student@urn:mace:lafayette.edu
    Download: Student@urn:mace:lafayette.edu:classes:${IDENTIFIER}
    For the "Featured" Submissions tab, I gave the non-system credentials the "download" right, and for the "Dropbox" tab I gave the non-system credentials the "dropbox" right.
    My understanding of this setup is that everyone should have had the ability to view the course and the contents of the "Featured Submissions" tab and that those in the College/Instructor/Student roles would be able to upload files via the "Dropbox" tab ... but not see the contents of said tab after the files were uploaded (aside from any files they uploaded themselves).
    This is not the behavior we saw however. While the College/Instructor/Student roles could upload files to the dropbox, everyone (including the unauthenticated public) was able to see all of the contents of the dropbox.
    The only way I could get this to work as advertised was to change all of the system credentials save the "Administrator" to "No Access":
    --- Credentials (System) ---
    Edit: Administrator@urn:mace:itunesu.com:sites:lafayette.edu
    No Access: Authenticated@urn:mace:itunesu.com:sites:lafayette.edu
    No Access: Unauthenticated@urn:mace:itunesu.com:sites:lafayette.edu
    No Access: All@urn:mace:itunesu.com:sites:lafayette.edu
    Once I did this, everything worked as advertised: College/Instructor/Student roles could upload tracks, and the "Dropbox" tab would only display tracks they uploaded.
    So my question is ... is this the correct behavior for the drop box? It looks like when the system credentials are in play, they're simply overriding whatever the normal "view" rule is for the drop box, which doesn't seem right.

    Your current configuration where things work as you wanted does seem correct to me. You are not using any System Credentials to accomplish the functionality and that's fine.
    Here's some more info to clarify how / why this is working for you and why you had to set "No Access" for the System Credentials:
    The System Credential "Authenticated@..." is going to get assigned to any user that goes through your transfer script. Even if you transfer script assigns no credentials to a user, upon entering iTunes U they will have at least 1 - the "Authenticated@..." credential. Therefore, unless you block access using "No Access", any user that passes through your transfer script is going to be able to access the area in question.
    When you change values for "Unauthenticated@..." or "All@..." you are defining what someone that DOES NOT pass through your transfer script can do. You want both of those to be "No Access" at the top level of your site if you do not want unauthenticated visitors.
    The distinction between "Unauthenticated" and "All" is that "All" applies to all users whether they pass through the transfer script or not.
    Here's another way to remember things:
    User passes through your transfer script, iTunes U automatically assigns:
    Authenticated@....
    All@....
    User does not pass through your transfer script and instead access your iTunes U site through derivable URL*, they get assigned:
    Unauthenticated@....
    All@....
    *The derivable URL for a site is: http://deimos.apple.com/WebObjects/Core.woa/Browse/site-domain-name
      Mac OS X (10.4.6)  

  • Easiest Way to Share Files Between Users? -- Public, Shared, Drop Box.. .

    We have five family members (and so five user accounts) using our Mac. What is the easiest way to copy files between / share files with / ... files from one user to the other?
    Shared ... Public ... Drop Box ...
    I do this so infrequently that I forget -- or have never figure it out properly.
    Any advice would be great.
    Thanks!

    The Shared folder is fine, but anything a user puts there will be read-only to all other users. If other users want to be able to edit such a file they can make a copy of it and edit the copy. If you want all users to be able to edit one of your files without them having to make a copy of it first, you must change the file permissions to allow that.
    There are a few ways to have new files automatically set so that others can write to them. Storing such files on an external hard drive on which file/folder ownership is set to be ignored is one way. You can also use ACLs - see this page for an example.

  • Public void getConfiguredList() { ....} //is the name correct

    hi,
    i have used the name in my project where i'm getting a list. actually the method will not return anything, but by that call i can get the list from some other notifier. here, is the method name getConfiguredList() with void return type correct?
    help!
    -karups

    yeah, that's correct.but, i might have implemented the method to directly return the value, but it takes longer time as the data is coming from server to the client. hence i used the notification mechanism, once the data is received, my calss will be informed with the data. here in my case after calling the method i'm doing nothing but waiting for the data to come.this way i release the thread lock,so the user won't get the feel of delay in response, coz he'll do any other operation in that time span. so, i guess, it,naming like this, makes sense in this particular situtation. pl. opine.

  • Code too large  for public void _jspService

    the file size is 820Kb.it was not getting compiled with a jasper compiler so i used a plain javac to try and compile and even that failed.Previously i had done the same for a 640k file and javac had worked fine but now it doesnt.Does even javac has a limit please feel free to suggest solutions which would help me to compile these files.Maybe memory settings please its urgent.

    There is no limit on the size of the source file.
    For auto-generated code you sometimes hit the size limitation on a method (64k bytes of bytecode).
    It is possible javac is running out of memory, tryjavac -J-Xmx128m

Maybe you are looking for

  • Portal users who have logged in during a specified time interval ?

    Hi, I need to know all the users who have logged in to the portal during a specific interval of time e.g during the last 10 days. Is there any provision to write code using UME api ? Any help would be highly appreciated and rewarded. Thanks & Regards

  • SharePoint PublishingHTML Field

    Hello Team, Good Afternoon. I have a query. I have been trying to do this for quite some time but not able to achieve it. Here is the scenario. I have 3 Columns. Column A is Multi-line, Column B is HyperLink & Column C is PubhishingHTML Field. Now, U

  • Creating Back-dated Sales Order

    Dear All, We create Sales Order with reference to Quotation, Only. Quotation is being prepared by sales _personnel and Accounts-personnel Create Sales Order with reference to that Quotation no. My Query is: If a Sales Personnel Creates Quotation on 3

  • HT2404 How do you find keys to software that is already installed?

    I am tasked with finding all the software keys of software that is installed on mulitiple Macs, and I have limited amount of physical keys.  Is there some type of program that will search the OS for installed software, and keys associated with them? 

  • Language=Javascript" CODEPAGE

    The first line of code automatically generated for two templates is <%@LANGUAGE="JAVASCRIPT" CODEPAGE="65001"%> This line of code appears at the top of a browser window in FF and ME7. One of the templates has a spry popup menu and the other has a PVI