Java to Native DND Inefficient By Design?

Unless I misunderstand things. It seems that any time I want a Swing object to be droppable on the native system I need to prepackage that object upon any drag into all the possible native forms. I just want to say that this totally sucks.
Shouldn't there be more negotiation between the native system and Java?
The scenario I envision is you begin a drag with an object, upon a drop with the native system, java tells the native drop target all available flavors, then the native drop target tells java the chosen flavor, then java actually packages the object into a transferable and releases it to the transfer handler of the native system.
This is so frusterating. I'm not really sure what to do. Except not include java to native DND.
Do the people out there today agree with me?

Like you aren't thinking this through. I can't even think of what a Timer would do in this case.
You cant use Timers to set off events because the drop event belongs to the Native System. The native system has to do things once the drop occurs. A timer can't come along later and say generate a native event. It doesn't make sense.

Similar Messages

  • How can I use java swing class in JSP page design

    I am a new developer in Java server pages. I want to use layout managers available in java swing classes to design the page. Can any body suggest me a way to do this.Is it possible if I do it with servelets.

    So, you want to use layout managers within your JSPs?
    The immediate answer is that "it isn't a good idea". The more considered answer is "tell us what you're up to".
    Are you coding all presentation within a traditional JSP? That is, HTML, customer or library tags and/java scriptlets?
    Or are you building your HTML within your servlets and sending that back to the browser?
    If the first, then you are probably better off either using explicit HTML tables (or the equivalent custom tags) or finding a library that you can use.
    If the second, you can write classes similar to the Swing layout managers that end up being a fancy way of putting elements into an HTML table. We have exactly that in my current environment. I wouldn't recommend rolling your own and I'd tend to leave all that presentation stuff to the JSP.
    In any case, you can't really use the Swing layout managers as they are for an entirely different pradigm.

  • How to root out memory leak with  Java JNI & Native BDB 11g ?

    We are testing a web application using the 32-bit compiled native 11g version of BDB (with replication) under 32-bit IBM 1.5 JVM via JNI under 64-bit RedHat Linux. We are experiencing what appears to be a memory leak without a commensurate increase in Java heap size. Basically the process size continues to grow until the max 32-process size is reached (4Gb) and eventually stops running (no core). Java heap is set to 2Gb min/max. GCs are nominal, so the leak appears to be native and outside Java bytecode.
    We need to determine whether there is a memory leak in BDB, or the IBM JVM or simply a mis-use of BDB in the Java code. What tools/instrumentation/db statistic should be used to help get to root cause? Do you recommend using System Tap (with some particular text command script)? What DB stats should we capture to get to the bottom of this memory leak? What troubleshooting steps can you recommend?
    Thanks ahead of time.
    JE.
    Edited by: 787930 on Aug 12, 2010 5:42 PM

    That's troublesome... DB itself doesn't have stats that track VM in any useful way. I am not familiar with SystemTap but a quick look at it seems to imply that it's better for kernel monitoring than user space. It's pretty hard to get DB to leak significant amounts of memory. The reason is that it mostly uses shared memory carved from the environment. Also if you are neglecting to close or delete some object DB generally complains about it somewhere.
    I don't see how pmap would help if it's a heap leak but maybe I'm missing something.
    One way to rule DB out is to replace its internal memory allocation functions with your own that are instrumented to track how much VM has been allocated (and freed). This is very easy to do using the interfaces:
    db_env_set_func_malloc()
    db_env_set_func_free()
    These are global to your process and your functions will be used where DB would otherwise call malloc() and free(). How you get usage information out of the system is an exercise left to the reader :-) If it turns out DB is the culprit then there is more thinking to do to isolate the problem.
    Other ideas that can provide information if not actual smoking guns:
    -- accelerate reproduction of the problem by allocating nearly all of the VM to the JVM and the DB cache (or otherwise limit the allowable VM in your process)
    -- change the VM allocated to the JVM in various ways
    Regards,
    George

  • Java iView Runtime Error in BEx Designer

    Hi,
    Through analyzer, Query is working absolutely fine
    When trying to run a query via the query designer I get the two messages :
    1.In development
    Java iView Runtime
    copyright 2002 SAP AG.All rights reserved.
    An exception occured while processing your request.
    If this situation persists,please contact your system administrator
    2.and in Quality
    503 Service Unavailable
    Application Stopped
    Thanking you,
    Tarun Brijwani.

    Hi,
    Thank you very much for your reply.
    From your reply, I have some doubts.
    You mentioned that you reduced the no of info objects in the rows in query definition and the problem got solved.
    1.Did you check that for the some queries which were already containing less no.of rows, it did not show this error.
    2.And you were getting this this error only in the those particular queries which were containing more no.of rows?
    3.Have you again tried by placing more no.of info objects in rows after you solved the error?
    Please reply even if you didn't try all these things coz it will be very helpfull for us in further investigation.
    Thanking You,
    Tarun Brijwani.
    Edited by: Tarun Brijwani on Feb 6, 2009 12:02 PM

  • Connect Java to native terminal (Solaris specifically)

    How can I connect to the native terminal through my own Java application?
    Calling my processes using Runtime.exec does not always work because the processes usually know it is not a terminal.
    Is there a way in Java to call a child as if through the terminal, or is there a way in Solaris to call a middle man process that calls the next child as if through the terminal?

    gimbal2 wrote:
    generally that is done by actually invoking the shell through runtime.exec(). I don't know what the main shell is under solaris, but under windows you would invoke CMD and under Linux you could invoke BASH for example.
    Start your adventures by reading the four pages of this article carefully:
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
    The fourth page shows an example of how to invoke the DIR command on windows.I started reading that document, I believe I already have all that under my belt. Perhaps I was too breif in my original question.
    If you run "ps -ef | more" in Solaris, it will show you one window-full of text at a time. If you resize your window, "|more" adjusts accordingly. That is because a terminal will tell the client height and width. That is one of the features of a terminal.
    If I went and ran "cp -i", it would ask if I wanted to replace any files I might be overwriting. But if I did it through System.exec() it would just overwrite because there is no terminal. (even if running through a shell like sh/bash)
    "prstat -a" (Solaris) will also detect if there is a terminal and provide underlined column headers.
    Java 6 has a Terminal object that is permitted to be null.
    What I really want is to make these processes think they are in a terminal. I am not too particular with window height/width and don't care much about underlines/bold/blink/strike/colors. (of course better to have these than to not :) )
    So how can I tell these processes they are in a terminal?

  • How to ivoke Java within native window

    The JNI tutorial says that JNI can be used (for example)to add applet support to a browser.
    Whenever I invoke classes via JNI they create their own top-level windows. How can you invoke java so that the application runs within a native window?

    Yes, that would certainly be onme way of doing it. I am sure that there is another way using native methods only that would be more efficient

  • Native Multi-VRF-Lite Design with EIGRP Question

    Hello,
    we think about to implement a VRF-Lite design (no MPLS and MBGP) in our campus network (10,000 ports, 20x 6500Sup720, 400x L2-Switches). MPLS is from our point of view oversized for our requirements. We need only a segmentation from different departments. Our IGP is eigrp.
    In the latest IOS-Release for the cat6500 (12.2.18SXD) is finally a VRF-Lite support for EIGRP inside.
    We could test successful a design with different VRFs in our lab, the division workes fine. But we didn't found a way to implement shared service. These are in our case DHCP, DNS, InternerAccess and some others. We thought about a redistribution between our global EIGRP routing table and the EIGRP-vrf tables, but we didn't found a way to do this.
    How can we do this?
    Thanks

    Use a crossover cable to connect a port belonging to the global routing table to a port belonging to a VRF. This way you can leak EIGRP routes from the global routing table into the VRF (through that physical connection). The drawback is that you use 2 ports (that could instead be used for other things...).
    Another way to this, would be to use static routing; use ip route vrf VRF x.x.x.x m.m.m.m n.n.n.n global to allow traffic to go from the VRF into the global routing table.
    Hope that helps...

  • Java and native browser communication

    Hello all,
    I am working on a project that parses an HTML document and retrieves specified data. This module of the app is complete. The app can easily read a URL specified by the user, but the contents of some URLs will of course be different when viewed through a browser due to cookies etc.
    Thus, I am trying to access the same HTML doc that a native browser is displaying (ie the same data that is shown upon "view source"). Does anyone know of a way to do this? Thanks in advance!
    derek

    DrClap wrote:
    derekn wrote:
    Thanks Chuck!
    I presently have a similar implementation which reads the HTML at a URL just fine. However, I essentially want to synchronize my app with the actual HTML that is displayed in a native browser. The reasoning behind this is that the browser will of course do redirects, automatic logins etc. at certain URLs due to cookies and such. It is impractical to attempt to mimick these actions in my app and hope to get the same HTML that the native browser is displaying, so instead I am trying to access the same data. Any thoughts?Okay. So you know what has to be done. If your question is then how to hack into the browser instead, and get it to disgorge its data, good luck to you. It isn't really impractical to handle cookies and redirects and basic authentication logins, though.After researching, I think the best thing to do will be to just embed a fully functional browser in my app using JDIC or a similar technology. Microsoft and Mozilla provide embeddable versions of their browsers. Because you're right, I would essentially have to hack a browser to access that data.

  • Java Script in Bex Web Application Designer

    I have created a web template in Bex WAD, written some java script function, i want to call this function on page load of every page,currently this function is getting called as soon as the first page is loaded but when i click on Next page or Prev page to show next 100 records then this function is not getting called, is there any way where in this function should be called always when user moves from one page to another.

    Hi thirumurugan
    The following link will solve your problem..
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/c01e9b01-abab-2d10-6687-96fc7bc39084?quicklink=index&overridelayout=true
    Regards,
    Ranganath.

  • Java spaceshooter design

    Hey all,
    i've been making a spaceshooter in java, but now i'm having design problems. my code is apparantly inefficient and lags like crazy on certain comps, but works fine on good comps. i've experimented with threading, but dont know an efficient way to thread. So far i have a thread to update drawing, a thread to updte movement, and a thread to check 4 all collisions. i also have a bunch of random threads that certain objects create, but thats not that big of a deal. also i'm using particle effects to create a shot, but thats the one thats causing the greatest lag as it hsato loop through to draw each tiny piece. Anyway i'm confused right now on how to make an efficient design so i'm asking for ideas and help on how to create a design. plz help all u can and plz dont flame me =(

    hmmm aiight. my code is somewhat confusing...wud anyone mind telling me how they wud do it? neway here's my code:
    //code from SimpleEnemy.java  
    EnemyShotPiece p=new EnemyShotPiece((int)Math.round(x), (int)Math.round(y));
    pieces.add(p);  //pieces is a vector of EnemyShotPiece
    int length=pieces.size();
    for(int i=0; i<length; i++)
         if(pieces.get(i).radius()<=0)
              pieces.remove(i);
              i-=1;
         length=pieces.size();
    //out.println((" "+pieces.size()));
    for(EnemyShotPiece ep:pieces)
         ep.move();
         ep.draw(g);
    public class EnemyShotPiece extends MovingObject
         double radius;
         int step=0;
         public EnemyShotPiece(int row, int col)
              super(row, col);
              //this.direction=direction;
              //this.speed=speed;
              //out.println(direction*(180.0/Math.PI));
              radius=10;
              //player=p;
         public void draw(Graphics g)
              //move();
              //out.println(row.get()+" "+col.get()+" "+radius);
              //g.drawArc(row.get(), col.get(), (int)Math.round(radius), (int)Math.round(radius), 0, 360);
              Graphics2D gg=(Graphics2D)g;
              //Color coll=gg.getColor();
              //gg.setColor(new Color(random.nextInt(256),random.nextInt(256),random.nextInt(256)));     
              Paint p=gg.getPaint();
              final GradientPaint gp=new GradientPaint(3, 3, Color.orange, width()/2.0f, height()/2.0f, Color.red, true);
              gg.setPaint(gp);          
              Ellipse2D e=new Ellipse2D.Double(row.get()+radius/2, col.get(), radius, radius);
              gg.fill(e);
              //gg.setPaint(Color.green);
              //gg.setStroke(new BasicStroke());
              //gg.draw(e);
              //gg.setPaint(gp);
              gg.draw(e);
              //e.setFrame()
              //gg.setColor(Color.ORANGE);
              //gg.drawOval((int)Math.round(row.get()+radius/2), (int)Math.round(col.get()), (int)Math.ceil(radius), (int)Math.ceil(radius));
              //gg.fillOval((int)Math.round(row.get()+radius/2), (int)Math.round(col.get()), (int)Math.ceil(radius), (int)Math.ceil(radius));
              //gg.setColor(coll);
              gg.setPaint(p);
              //g.fillOval(row.get(), col.get(), (int)Math.round(radius), (int)Math.round(radius));
         public void setImage()
         public int radius()
              return (int)Math.round(radius);
         public void move() //object doesnt move itself, only radius gets decremented
              radius-=.5;
    }sorry if the code is knda funky, i had a lot of test statements in there.

  • [Java and all else] How do you document DB design?

    Hello,
    Although most of the technical choices are explicit in SQL (UniqueKey & ForeignKey constraints, indexes,...), the semantics of the data columns and their constraints seem better served as plain human-readable comments ("ID column: identifies the plane copy; 6 figures are enough as we don't expect to sell more than 1 million planes in a foreseeable future...").
    In my current system, (EJB-based, but the DB schema is not created by the JPA-compliant ORM, but via SQL scripts), I see the following ways to write and maintain this documentation:
    - SQL comments in the schema creation and patch scripts
    - Javadoc comments in the Java source of the Entity classes.
    - UML notes in UML diagrams(1)
    - external "Architecture and design" document.
    All 4 of them are used, sometimes inconsistently, for various parts of the design choices; I mean, the docs do not contradict themselves (not yet, but it's a mere question of time), but some tables are commented in SQL scripts, others are in design docs, and the details for some columns are in entity javadocs. Although each developer may find it handier to "write" the doc via his preferred medium, it becomes increasingly difficult to "maintain" theoverall documentation.
    Our current situation is that most of the project team members are Java developers, so it would probably be better accepted and served if we standardized that we document DB tables and columns in Java source, but I am worried that:
    - someone else pouring over our DB (ex: DBA helping us to optimize things, or other team developping a data-mining tool to leverage the historical data in DB) may not be as comfortable with Java
    - this may not cover all design choices of the DB schema:
    - - - - first, although that is the case currently, in the future there might not be a 100% 1-1 mapping between e.g. each entity class and a DB table. Maybe some columns will not need to be mapped anymore,...
    - - - - second, I fear some DB constructs are not amenable to Java counterparts; no accurate idea there, I'm not an SQL nor JPA expert, but I presume Indexes, table partitioning, tablespaces, for example (yes, the DBMS is Oracle :o) are not taken into account in JPA mapping.
    And if we document those choices at the SQL level (my preferred idea so far), this will gradually make the javadocs in the entities obsolete, or removed altogether, and that will make future maintenance of the Java source risky.
    How do you document your DB design in general?
    Do you have specific advices for my case?
    Thanks in advance,
    J.
    (1) Just for the record, here are a few posts that refer to modelling the DB in UML:
    [A post on this forum highlighting that UML 1.4 standardizes a notation for RDB modelling|http://forums.sun.com/thread.jspa?messageID=1383724#1383724]
    [A DB modelling tutorial|http://www.tomjewett.com/dbdesign/dbdesign.php] (not sure whether it leverages the standard mentioned above :o)
    P.S.: "Java and all else" as in, damn, I'd love to use the familiar JDC forums and people to discuss not only Java-related issues, but also [all other things that surround Java|http://forums.sun.com/thread.jspa?threadID=5422264&tstart=0] (other technologies, processes, people) and enable to make workable systems out of Java code.

    jduprez wrote:
    Thank you again.
    A couple more questions:
    2. Table, and proc dictionary maintained as one or more text files. Those files and schema are all in source control.Do you mean, a proprietary text format (a la tabledesign.txt), or +.sql+ source files? Again, you seem to suggest the scehma info is present in two locations.I didn't say two locations unless you meant files. Then yes.Yes I meant two files. I trust the team to get the doc file lagging a few revisions behind the SQL file, and to correct that I would have to include one more step in the review process (e.g. "review CM actions to check that the doc file is updated consistently with the SQL source").
    The tool I wrote would throw errors if the comment file didn't match the schema. And if comments were not provided. That of course doesn't stop someone from documenting a table with "a table".
    You can of course keep the addtional info as special comments in the SQL, but when I did this, and even in retrospect, it seems better and perhaps easier to keep them seperate. I have done special comments in SQL before and it seems a bit of a kluge but you do have the single source. But in that case I was the only one maintaining it too.What do you mean by "special"?For code generation I have a schema file with the following (pseudo sql.)
        create mytable
           mytable_id int,
           column_foo varchar(10);
           column_fum varchar(20)
            -- Query: for_a_query (column_foo, column_fum)
        )The generator consumes the schema and generates the standard CRUD which would include a query based on the primary key.
    The above comment is used to provide an additional query where the proc is named 'for_a_query' (munged with table name) and takes two parameters (column_foo, column_fum) whose type/name matches those of the table.
    If we don't try to generate a browseable HTML out of the schema (although the idea is appealing, I don't have the resource to make such a tool), do you see anything kludgy in maintaining SQL comments interpersed within DDL code?
    Of course that is doable.

  • How to design a custom browser using Java?

    Hi,
    Which of the Java APIs (packages) we have to use to design a custom browser?
    thanking you,

    R6i wrote:
    Hi,
    I will agree with your words jverd.
    But, APIs like WebRenderer API (http://www.webrenderer.com/) can be used in developing Browsers (of course, this API is also based on Core APIs of Java).
    Here my question is what are the different packages of Java that are needed exactly to design Browser with out the help of THIRD PARTY API(like WebRenderer API).
    thank you.You're totally missing the point.
    Which tools should I use to build a house?
    Which ingredients should I use to cook a meal?
    Which subjects should I study in college?

  • [Java 3D] Wich OpenGL versions are supported by natives libraries ?

    Hi,
    anyone could tell me which OpenGL specifications are supported by Java 3D natives libraries ?
    Thanks in advance.

    Hi,
    Java 3D requires at least OpenGL 1.2. It runs on all newer releases up to the current release 4.1 and will run on future versions. Java 3D creates an OpenGL compatibility profile context supporting the (legacy) fixed function pipeline as well as the OpenGL Shading Language GLSL.
    Java 3D's on-screen and off-screen rendering capabilities correspond to OpenGL 2.0 and support vertex and fragment shaders inclusive newest shading language features. On my OpenGL 3.2/DirectX 10 capable graphics device I successfully ran GLSL 1.5 features, see http://www.java.net/forum/topic/javadesktop/java-desktop-technologies/java-3d/shaders-java-3d-0 .
    August

  • Embedding/Wrapping a Native GUI App in Java?

    Hi, we have loads of C++ GUI applications... I'd like to be able to embed/wrap some of them inside our swing app's. I believe this is possible, but don't actually know the terminology to get started with this.
    --Cheers :)                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    This is going to be tricky, but as a starting point you might want to check out Java AWT native interface.
    http://java.sun.com/j2se/1.5.0/docs/guide/awt/1.3/AWT_Native_Interface.html

  • Network Java Native Library libnet.jnilib source code or functions name

    Hi,
    I am using libnet.jnilib in my networking project but i am not aware about the internal structure of this library. Is this open source library? Is oracle JNI project open source as jdk? If It is, Where can i get source code for that? If It is not, Can u help me to get the methods name and signatures for the libnet.jnilib library?
    Thank you,
    Gaurav

    You're looking in the wrong place, so it's pointless. You can't get any information about what the TCP/IP stack is doing at the network layer or what the NIC is doing at the physical layer from Java's native code. All it does is call the C Sockets API. It is essentially part of the application, not part of the operating system or network layer or physical layer, and it doesn't know any of those from Adam.
    You need to attach some drivers into the network stack to get that kind of information. All that you could get by instrumenting Java's native networking code is the flow of data into and out of the application, and you can get that via network stack drivers too. You should also have a look at the several implementations of Jpcap.

Maybe you are looking for

  • Creating A Report need PHP MYSQl HElP

    I have a table "officers" table two with 4 fields all with variable char which will end up just being names. However, I need to create a report that counts each the occurance of each name and ouputs the name with the count next to it. The names in ta

  • Add .js to JSP

    I have tried including as .js file to the JSP page something like this: <% String url = componentRequest.getWebResourcePath() + "/scripts/my.js";%> and if i use something like this: <script language="JavaScript" src="<%=url%>"></script> to call a fun

  • Sticky resource not available - ACE Module

    hi, I am getting the below error on defining stickiness. Please assist. switch/Admin(config)# sticky ip-netmask 255.255.255.255 address both ACE-CKH-STICKY Error: sticky resource not available Thanks.

  • Function calling in thread

    I know that every thread has it own stack which is not shared with the other threads. Now for example, I have a program like: Whenever a user connects to the server a separate thread is created and receive method is called. mythread = new thread(this

  • Endroutine help urgent

    Hi all, We have written a code in endroutine. when debugging, it is showing the records in result_package correctly only but when executed, it si showing following errors : Exceptions in Substep: write Data Package Processing Terminated Data package