Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

drag and drop using jsp

Status
Not open for further replies.

dexter195

Programmer
Jun 18, 2003
220
EU
hi,
do any of ye know if its possible to drag images from one table to another using jsp?
 
The question should be "can you drag and drop using HTML, CSS or Javascript" - as this is ultimately what JSP generates. And the answer to that question (AFAIK) is no ... but you may want to ask in the HTML/CSS or Javascript forum.

--------------------------------------------------
Free Database Connection Pooling Software
 
i can drag and drop at the moment using html and javascript but as far as i can see you can't trasnport (if thats the right terminology) the javascript variables to the java variables on the jsp page.

would i be right in saying this or is there any way around it.

cheers for the help
 
Why would you want to use javascript variables in Java ? The Java gets executed on the server - the Javascript gets executed on the client ...

--------------------------------------------------
Free Database Connection Pooling Software
 
at a later stage ill be using a database to upload stuff onto the webpage into tables, and this will be dragged onto another table, so that the user can create what they want in the second table using a mixture of images and text then that will be uploaded back to the database
 
Perhaps you could post a succinct example - I'm havig problems understanding what you mean - and how javascript variables will affect your embedded java code ...

--------------------------------------------------
Free Database Connection Pooling Software
 
sorry for late reply,
i have to give the html/javascript a miss for the moment.
i have to get this drag and drop functionality working using java in a jsp page. at the moment i have it working, but its opening up in a seperate popup window.

i have samples of this drag and drop functionality working in applets that are 'stuck' on the web page but this doesnt work in the jsp page.

again cheers for your help :)
 
here is the code im trying to get working in the jsp page, im using Tomcat/5.0.28 as my server but this applet wont work in the jsp page.

Code:
package com.test;

import java.awt.TextField;

import javax.swing.*;

public class testApplet extends JApplet
{
    
    public testApplet()
    {
        super();
        
        TextField txt1 = new TextField("", 30);
        
        add(txt1);
    }
    
    private static void createAndShowGUI()
    {
        JFrame.setDefaultLookAndFeelDecorated(true);

        //Create and set up the window.
        JFrame frame = new JFrame("DragPictureDemo");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        //Create and set up the content pane.
        testApplet demo = new testApplet();

        frame.setContentPane(demo);

        //Display the window.
        frame.pack();
        frame.setVisible(true);
    }
    
    public void init()
    {
        //Schedule a job for the event-dispatching thread:
        //creating and showing this application's GUI.
        javax.swing.SwingUtilities.invokeLater
        (new Runnable()
            {
	            public void run()
	            {
	                createAndShowGUI();
	            }
            }
        );
    }    
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top