• Post Reply Bookmark Topic Watch Topic
  • New Topic

Drag and Drop and the JFrame...  RSS feed

 
George Thomas
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greetings Swingers!
I was hoping some of you ranch hands might shed some light on this phenonmenon.
I have a Swing application that uses the JTree and have implemented drag and drop. The application runs as an applet and the drag and drop in the tree triggers messages to servlets and then manipulates a back end Oracle database accordingly. Quite cool!
This all works fine when I use the JFrame but when I put the JTree directly on the JApplet container (which causes the app to be "fixed" on the HTML page as opposed to bringing up the JFrame in a separate window) some drag events fire and some don't. I have put System.err.println statements in all the DnD events so I can see in the Java plug-in console whats happening.
Has anyone experienced this phenomenon? Is there something inherent in the JFrame that captures events in a different way?

I'll supply code if y'all would like to try this out...its test code that doesn't do any applet-servlet comm or db stuff.
I would be most gratefull for any insight here...thanx in advance.
George.
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you used the Sun plug-in to get your browser to use the 1.3 version of java?
 
George Thomas
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply Cindy.
Yes, I'm using the 1.3 plug-in. I guess its not such a great big deal to have the Java Applet Window appear for DnD functionality but from a UI perspective its nice to have the tree "planted" on the html page of the browser. You have issues of losing focus and the Java Applet Window dissapearing behind the browser etc.
Care to take a stab at the code? And if so how do I format it to keep everybody happy?
George.
 
Carol Enderlin
drifter
Ranch Hand
Posts: 1364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read the faq:
http://www.javaranch.com/ubb/faq.jsp#q4
The plain and simple answer is to put tags around your code.
 
George Thomas
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Many thanks Carol.
George.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!