Solved

icon drag drop

Posted on 2001-07-04
32
407 Views
Last Modified: 2013-12-14
Hi
this application is just like the windows explorer and when evr i i click the icon from the tree view
the right handside the corresponding subnodes r displayed ....and it goes on like that...
what i have to do is i have to drag one icon from an icon pallet (which will be in menubar) and drop
in the right pane and it should be added to that particular top level node ..do explain with me codings....
both the drag drop should be in the same window
0
Comment
Question by:aravindmalai
  • 14
  • 11
  • 4
  • +2
32 Comments
 
LVL 15

Expert Comment

by:ozymandias
ID: 6252756
You want code for JTree, TreeeSelectionListeners, TreeModels, and all the classes and interfaces associated with Drag 'n' Drop...and you want all this for 10 points ?!

Wow, do you want the moon on a stick too ?!
0
 

Author Comment

by:aravindmalai
ID: 6252785
i have increase the points to 20 ..
0
 
LVL 15

Expert Comment

by:ozymandias
ID: 6253077
You don't understand.
Have you ever implemented Drag and Drop in java before ?
This is a 200 - 300 point question.
You are asking for a lot of code to be written.
0
 

Author Comment

by:aravindmalai
ID: 6253195
yes i didnt understand ...if i have done the code before ..why should i ask others.....ok ill increse the points to 75..only thing is that i have 75 points only
0
 
LVL 92

Expert Comment

by:objects
ID: 6254003
Here's some references:
www.rockhopper.com
www.javaworld.com (two articles can't remember exact url's)
And Sun's Java tutorial has an example also.


0
 
LVL 1

Expert Comment

by:tonus
ID: 6254530
0
 
LVL 92

Expert Comment

by:objects
ID: 6254538
tonus,

Thanks for 'expanding' my references :-)
0
 
LVL 15

Expert Comment

by:ozymandias
ID: 6255096
Here is the Sun Java Drag 'n' Drop Tutorial with detailed examples :

http://java.sun.com/docs/books/tutorial/dnd/index.html

Here is the Sun Java tutorial on JTrees with detailed examples :

http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html

By combining these two you should be able to write the stuff you want.

I have produced an example of the application you describe but it is 380 lines of code. I do not think that 75 points is enough for that much work. It's a matter of principle.
0
 

Author Comment

by:aravindmalai
ID: 6255317
i want the most appropriate code ..these eg (sheel gupta) i i have seen it before itself for drag drop ..they r just dragging a String and dropping mine is different ..u have to drag and drop the icon from the icon pallete and it should be added to that particular node ..iuf ur not satisfied i can offer u 150 points but iu have to give me the exact code...
0
 
LVL 15

Expert Comment

by:ozymandias
ID: 6255356
OK. Up the points to 150 and I will post the full source code, but I expect an A grade.
0
 

Author Comment

by:aravindmalai
ID: 6256318
ok i have increased the points to 150 u now provide me th code with the following feutures
a)logical tree nodes and when i click the following node in the left handside it should display the coreesponding tree subnodes
b)also u should provide an icon pallette(from the menu bar) where i should be able to drag and drop that icon to that right pane and it should be added to that particular node
3) particularly i should ba able to drag and drop the icon..
4) dfault cursor should be changed
if u provide me with this ill award 150 points with A grade
send me as soon as possible
0
 
LVL 15

Expert Comment

by:ozymandias
ID: 6256749
OK. I am going to try to post the code here, but it's a lot of code. If the system wont accept it I will provide you with a link from which you can download the code.
0
 
LVL 15

Accepted Solution

by:
ozymandias earned 200 total points
ID: 6256752
/*
 *
 * A lot of the classes in this file have been implemented as internal classes.
 * This is not necessarily the best way to do it "for real", but in the interests
 * of having a simple, single, compilable file that runs the whole application I
 * have done it that way.
 *
 * I have also hardcoded the icons as byte arrays for the same reason.
 *
 */

import java.util.*;
import java.awt.*;
import java.io.*;
import java.awt.event.*;
import java.awt.dnd.*;
import java.awt.datatransfer.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.tree.*;

public class DNDJTree extends JFrame{

      Container contentPane;
      JTree charTree;
      DefaultTreeModel treeModel;
      JScrollPane scroller;
      JSplitPane jsp;
      ChildNodeList cnl;
      JPanel topPanel;
      JPopupMenu jpm;
      ImageIcon[] icons;

      public DNDJTree(String args[]){
            super("DNDJTree");
            this.setDefaultCloseOperation(EXIT_ON_CLOSE);
            icons = new ImageIcon[6];
            //The icons are being hardcoded into this file as byte arrays for simplicity.
            byte[] b;
            b = new byte[]{      71,73,70,56,57,97,24,0,24,0,-9,-1,0,0,0,0,-1,-1,-1,-64,-64,-64,
                                    17,16,17,30,29,30,33,32,33,46,45,46,54,53,54,67,66,67,108,107,
                                    108,-105,-107,-61,-92,-94,-48,-102,-104,-63,-85,-87,-45,-89,
                                    -91,-50,-72,-74,-32,-72,-74,-35,-65,-67,-28,-59,-61,-22,-52,
                                    -54,-15,-117,-118,-71,-112,-113,-67,-116,-117,-72,-104,-105,
                                    -58,-105,-106,-61,-99,-100,-54,-103,-104,-59,-92,-93,-48,-98,
                                    -99,-56,-98,-99,-57,-103,-104,-63,-92,-93,-50,-92,-93,-51,
                                    -85,-86,-43,-79,-80,-37,-85,-86,-44,-90,-91,-50,-79,-80,-38,
                                    -79,-80,-40,-73,-74,-34,-79,-80,-41,-73,-74,-35,-83,-84,-47,
                                    -66,-67,-27,-60,-61,-21,-66,-67,-28,-60,-61,-22,-65,-66,-28,
                                    -70,-71,-34,-53,-54,-15,-60,-61,-23,-52,-53,-15,-47,-48,
                                    -10,111,111,-98,124,124,-85,126,126,-85,126,126,-86,-121,
                                    -121,-75,-117,-117,-71,-113,-113,-67,-117,-117,-72,-117,
                                    -117,-73,-108,-108,-62,-104,-104,-58,-106,-106,-61,-100,
                                    -100,-54,-104,-104,-59,-93,-93,-48,-99,-99,-56,-99,-99,-57,
                                    -93,-93,-50,-86,-86,-43,-80,-80,-37,-86,-86,-44,-86,-86,-45,
                                    -73,-73,-32,26,26,27,45,45,46,53,53,54,73,73,74,123,123,
                                    124,107,107,108,-113,-112,-67,-100,-99,-54,29,30,30,32,33,
                                    33,53,54,54,123,124,124,32,33,32,40,41,40,45,46,45,73,74,73,
                                    107,108,107,17,17,16,33,33,32,111,111,110,87,87,86,14,13,13,
                                    17,16,16,27,26,26,67,66,66,114,113,113,111,110,110,95,94,
                                    94,87,86,86,-14,-14,-14,-52,-52,-52,-71,-71,-71,-84,-84,
                                    -84,127,127,127,124,124,124,117,117,117,114,114,114,111,
                                    111,111,100,100,100,94,94,94,87,87,87,86,86,86,77,77,77,
                                    73,73,73,67,67,67,64,64,64,54,54,54,53,53,53,46,46,46,45,
                                    45,45,40,40,40,33,33,33,30,30,30,29,29,29,26,26,26,14,14,14,
                                    13,13,13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33,-7,4,
                                    1,0,0,2,0,44,0,0,0,0,24,0,24,0,0,8,-1,0,5,8,28,72,-80,-96,
                                    -63,-125,2,8,1,32,-108,-90,-96,26,-123,12,17,10,-20,-30,
                                    36,79,-60,-127,-124,-68,-32,-71,115,-47,32,-128,64,126,
                                    -20,0,88,-45,80,32,-128,62,122,-22,0,8,-128,-112,-112,-104,
                                    -118,114,86,14,100,82,0,1,-57,-110,30,1,101,-79,67,-25,34,
                                    33,66,124,-84,-96,25,-119,115,-32,-62,46,123,-14,-60,92,99,
                                    -110,9,22,60,79,-94,-68,97,89,80,33,-107,-99,96,-36,44,92,
                                    24,-58,64,-54,51,29,-115,18,26,0,-13,11,68,0,-126,-2,-112,
                                    -39,-110,64,102,85,0,84,66,-46,-71,-78,-11,103,-109,-108,
                                    115,8,-79,-95,42,16,34,82,-91,102,-50,50,-87,98,-109,11,
                                    -100,-80,91,9,-56,-43,10,113,-112,-106,3,117,-26,-76,113,
                                    -37,-73,46,0,57,113,-50,-114,-87,91,70,47,85,-120,53,126,
                                    72,-23,1,0,-118,101,27,58,-90,-32,-128,88,114,97,-114,11,
                                    59,22,16,41,97,-39,7,-123,32,10,-114,-128,80,-8,-71,-122,
                                    -122,52,27,56,32,81,66,98,-85,13,11,1,48,-124,48,-78,-60,
                                    -61,69,0,66,-92,12,33,34,-94,-63,10,8,16,121,76,1,114,-28,
                                    -61,3,19,18,-36,18,108,-86,-80,-95,-120,8,37,45,32,76,24,
                                    9,32,3,-122,36,31,-106,-96,-112,16,-31,57,-113,14,37,-84,
                                    -97,-104,-96,-126,33,-95,27,35,-128,-16,29,11,17,-64,-32,
                                    86,0,0,84,-73,66,10,51,-56,-32,-39,66,-34,-103,-32,-62,
                                    11,52,16,37,80,26,107,0,-32,-64,9,49,-12,-73,-105,0,8,18,
                                    -62,0,11,45,24,72,18,65,24,-42,-75,87,73,33,110,69,18,95,
                                    23,6,-112,-122,-116,48,-126,56,-29,-115,18,-27,40,81,64,
                                    0,33,-2,79,67,111,112,121,114,105,103,104,116,32,50,48,
                                    48,48,32,98,121,32,83,117,110,32,77,105,99,114,111,115,
                                    121,115,116,101,109,115,44,32,73,110,99,46,32,65,108,
                                    108,32,82,105,103,104,116,115,32,82,101,115,101,114,118,
                                    101,100,46,13,10,74,76,70,32,71,82,32,86,101,114,32,49,
                                    46,48,13,10,0,59};
            icons[0] = new ImageIcon(b);
            b = new byte[]{      71,73,70,56,57,97,24,0,24,0,-94,-1,0,-1,-1,-1,-52,-52,-52,-103,
                                    -103,-103,102,102,102,51,51,51,0,0,0,-64,-64,-64,0,0,0,33,-7,
                                    4,1,0,0,6,0,44,0,0,0,0,24,0,24,0,0,3,107,104,-70,-36,-2,48,
                                    -54,85,-22,-116,37,-24,114,21,-7,96,40,70,4,-96,-99,-127,
                                    -96,-86,67,9,-119,112,8,-112,38,-102,-78,-27,-4,2,66,
                                    26,12,1,-126,-128,-48,-46,-19,122,61,-96,-112,-24,-94,
                                    33,127,-63,97,81,82,122,42,-91,-51,-93,-17,-54,52,62,
                                    -86,-37,104,-105,-54,11,47,-89,78,51,-42,-21,0,39,-59,
                                    104,-19,-5,-100,-3,-106,-25,107,-78,-19,38,-120,127,99,
                                    34,108,14,0,-124,-123,-122,-123,29,-119,-118,19,9,0,33,
                                    -2,79,67,111,112,121,114,105,103,104,116,32,50,48,48,48,
                                    32,98,121,32,83,117,110,32,77,105,99,114,111,115,121,115,
                                    116,101,109,115,44,32,73,110,99,46,32,65,108,108,32,82,
                                    105,103,104,116,115,32,82,101,115,101,114,118,101,100,46,
                                    13,10,74,76,70,32,71,82,32,86,101,114,32,49,46,48,13,10,0,59};
            icons[1] = new ImageIcon(b);
            b = new byte[]{      71,73,70,56,57,97,24,0,24,0,-26,-1,0,-1,-1,-1,-25,-25,-1,
                                    -25,-26,-1,-26,-25,-1,-26,-26,-1,-27,-27,-1,-27,-27,-2,-28,
                                    -28,-3,-29,-29,-3,-30,-30,-4,-31,-31,-5,-32,-32,-7,-33,-33,
                                    -7,-34,-34,-8,-35,-35,-10,-36,-36,-11,-38,-38,-12,-39,-38,
                                    -13,-39,-39,-14,-40,-40,-15,-41,-41,-16,-44,-44,-19,-45,
                                    -45,-20,-46,-46,-21,-47,-47,-22,-48,-48,-23,-51,-51,-25,-51,
                                    -51,-26,-52,-52,-1,-52,-52,-26,-77,-77,-52,-77,-78,-52,-78,
                                    -77,-52,-78,-78,-52,-78,-78,-53,-79,-79,-53,-80,-80,-54,-80,
                                    -81,-55,-81,-80,-55,-82,-81,-56,-82,-82,-56,-82,-82,-57,-83,
                                    -83,-58,-84,-84,-59,-85,-85,-60,-86,-86,-60,-87,-87,-62,-89,
                                    -89,-63,-90,-90,-64,-91,-90,-65,-92,-91,-66,-92,-92,-66,-93,
                                    -92,-67,-93,-93,-67,-94,-94,-68,-96,-96,-70,-97,-97,-71,-98,
                                    -98,-72,-99,-99,-73,-101,-101,-76,-102,-102,-77,-103,-103,
                                    -77,-103,-103,-78,0,0,0,-64,-64,-64,0,0,0,0,0,0,0,0,0,0,0,0,
                                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
                                    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,33,-7,
                                    4,1,0,0,64,0,44,0,0,0,0,24,0,24,0,64,7,-76,-128,64,-126,-125,
                                    -124,-123,-122,-122,63,0,26,49,12,-119,58,26,-113,63,28,28,63,
                                    -121,-126,63,-104,-103,0,39,1,30,-99,1,41,20,58,-119,-120,
                                    -118,-113,-93,-109,-107,-106,-123,-119,-97,-114,-117,14,-100,
                                    -98,-104,-85,-125,-103,-73,-72,0,-120,-72,-103,-75,-84,-90,
                                    21,-68,-67,-85,-119,14,-77,0,-89,21,49,1,-110,-86,-91,-82,0,
                                    49,14,37,-97,-98,41,-92,-75,-119,-98,-42,20,56,-112,-40,-66,
                                    -31,-30,-29,-105,0,-26,-25,-76,-29,-81,58,21,47,-51,-22,-56,
                                    -117,-119,-25,-26,-23,-106,-119,-46,30,-119,-112,-112,-63,
                                    -108,-60,0,-88,-23,51,-75,40,0,53,123,-65,-74,-19,-53,87,-115,
                                    -103,-82,-124,-96,-118,-103,104,-8,34,-40,-61,66,-12,90,109,
                                    3,-43,77,3,-72,123,0,62,-99,-96,16,-125,-33,71,75,-12,82,-98,
                                    35,23,46,16,0,33,-2,79,67,111,112,121,114,105,103,104,116,32,
                                    50,48,48,48,32,98,121,32,83,117,110,32,77,105,99,114,111,115,
                                    121,115,116,101,109,115,44,32,73,110,99,46,32,65,108,108,32,
                                    82,105,103,104,116,115,32,82,101,115,101,114,118,101,100,46,
                                    13,10,74,76,70,32,71,82,32,86,101,114,32,49,46,48,13,10,0,59};
            icons[2] = new ImageIcon(b);
            b = new byte[]{      71,73,70,56,57,97,24,0,24,0,-60,-1,0,0,0,0,-1,-1,-1,-79,65,
                                    84,-66,78,97,43,90,43,56,103,56,-59,-58,70,-46,-45,83,-125,
                                    -125,53,-36,-36,-70,-23,-23,-57,-61,-61,-77,-48,-48,-64,-70,
                                    -76,93,-57,-63,106,-84,-128,64,-71,-115,77,-14,123,112,-1,
                                    -120,125,-85,-128,126,-72,-115,-117,-39,-81,-83,-26,-68,-70,
                                    -98,40,40,-85,53,53,-14,107,107,-1,120,120,-14,-14,-14,40,
                                    40,40,27,27,27,13,13,13,-64,-64,-64,33,-7,4,1,0,0,31,0,44,
                                    0,0,0,0,24,0,24,0,0,5,-58,-32,39,-114,100,105,-98,-24,-41,
                                    113,93,-22,-86,84,69,-75,-17,-55,85,86,-59,-43,38,55,-27,51,
                                    94,-87,83,-8,-47,78,30,64,114,-87,-20,64,8,5,2,71,73,-11,108,
                                    68,-128,-64,70,-53,-35,112,12,7,105,-89,27,-56,-118,-84,-118,
                                    68,58,-51,121,28,30,-125,78,90,-109,-47,36,-84,-40,64,-62,-47,
                                    -32,43,58,7,6,16,2,28,106,23,24,23,10,102,31,104,106,106,78,
                                    -126,-124,-114,-120,24,119,87,31,89,-114,108,96,112,114,106,
                                    17,18,17,-118,1,103,27,107,9,109,111,113,-89,-89,120,-104,
                                    122,107,-128,-111,-123,124,-75,106,-117,-115,127,16,-77,-102,
                                    -67,-82,-103,-101,-86,114,125,-60,14,-73,-92,-116,-90,-88,110,
                                    -99,-84,-66,-105,-64,29,12,8,-125,-123,-50,107,-72,84,28,11,
                                    12,-124,85,-33,75,-105,91,91,-46,11,28,-29,100,-24,91,61,-26,
                                    66,39,43,-18,54,-15,-13,41,33,0,33,-2,79,67,111,112,121,114,
                                    105,103,104,116,32,50,48,48,48,32,98,121,32,83,117,110,32,77,
                                    105,99,114,111,115,121,115,116,101,109,115,44,32,73,110,99,
                                    46,32,65,108,108,32,82,105,103,104,116,115,32,82,101,115,101,
                                    114,118,101,100,46,13,10,74,76,70,32,71,82,32,86,101,114,32,
                                    49,46,48,13,10,0,59};
            icons[3] = new ImageIcon(b);
            b = new byte[]{      71,73,70,56,57,97,24,0,24,0,-77,-1,0,0,0,0,-1,-1,-1,74,102,76,
                                    118,-111,120,-125,-98,-123,-115,-87,-113,-102,-75,-100,-89,-62,
                                    -87,-71,-43,-69,-58,-30,-56,-14,-14,-14,-88,-88,-88,122,122,122,
                                    108,108,108,13,13,13,-64,-64,-64,33,-7,4,1,0,0,15,0,44,0,0,0,0,
                                    24,0,24,0,0,4,117,-16,-55,73,-85,-67,-45,41,-52,43,-48,93,-88,
                                    -127,33,6,4,8,89,86,90,-110,110,-91,-13,-51,-88,-85,118,90,-96,
                                    -24,-82,13,-117,-120,94,112,120,-29,56,-122,66,-33,-22,-104,
                                    36,-2,112,-56,104,17,-61,-116,42,99,86,-94,69,-58,-99,85,-101,
                                    69,-121,-31,48,54,20,4,95,-28,105,91,38,-97,-45,87,86,-37,-116,
                                    -74,-82,-27,-28,60,-3,123,-89,-120,-11,122,111,3,4,0,11,79,15,
                                    93,-119,94,0,13,12,58,22,59,-111,58,-109,-110,59,43,-105,-104,
                                    37,17,0,33,-2,79,67,111,112,121,114,105,103,104,116,32,50,48,
                                    48,48,32,98,121,32,83,117,110,32,77,105,99,114,111,115,121,115,
                                    116,101,109,115,44,32,73,110,99,46,32,65,108,108,32,82,105,103,
                                    104,116,115,32,82,101,115,101,114,118,101,100,46,13,10,74,76,
                                    70,32,71,82,32,86,101,114,32,49,46,48,13,10,0,59};
            icons[4] = new ImageIcon(b);
            b = new byte[]{      71,73,70,56,57,97,24,0,24,0,-77,-1,0,0,0,0,-1,-1,-1,48,48,97,
                                    61,61,110,-111,-111,-62,-98,-98,-49,-62,-62,-14,-49,-49,-1,
                                    -14,-14,-14,13,13,13,-64,-64,-64,0,0,0,0,0,0,0,0,0,0,0,0,0,
                                    0,0,33,-7,4,1,0,0,10,0,44,0,0,0,0,24,0,24,0,0,4,-106,80,-55,
                                    73,-85,-67,119,-32,109,69,-30,-96,50,24,95,72,1,9,42,28,68,
                                    25,-90,-121,17,-57,69,-5,-54,68,-83,-25,45,-78,37,-122,-99,
                                    -80,-9,11,-14,82,9,65,45,-31,67,57,3,19,0,107,-119,8,32,6,
                                    68,69,34,71,-14,41,-92,71,-81,-62,35,6,-44,14,0,-88,-42,-56,
                                    -92,12,-60,90,110,-5,59,77,79,-110,-108,-19,-39,-66,-90,74,
                                    -74,26,127,60,104,106,95,72,118,122,30,40,60,5,93,19,86,-112,
                                    8,122,-116,-116,-114,24,-109,67,49,115,24,-110,92,51,50,40,
                                    112,-100,91,7,-118,41,86,38,10,-110,6,111,-112,-87,19,-110,
                                    2,-123,-81,-80,111,-76,22,85,-73,-70,17,0,33,-2,79,67,111,
                                    112,121,114,105,103,104,116,32,50,48,48,48,32,98,121,32,83,
                                    117,110,32,77,105,99,114,111,115,121,115,116,101,109,115,44,
                                    32,73,110,99,46,32,65,108,108,32,82,105,103,104,116,115,32,
                                    82,101,115,101,114,118,101,100,46,13,10,74,76,70,32,71,82,32,
                                    86,101,114,32,49,46,48,13,10,0,59};
            icons[5] = new ImageIcon(b);
            contentPane = this.getContentPane();
            contentPane.setLayout(new BorderLayout());
            treeModel = populateTree(4,2);
            charTree = new JTree(treeModel);
            scroller = new JScrollPane(charTree);
            cnl = new ChildNodeList();
            cnl.setCellRenderer(new MyListRenderer());
            treeModel.addTreeModelListener(cnl);
            topPanel = new JPanel();
            for (int i = 0; i < icons.length; i++){
                  topPanel.add(new DraggableJLabel(this, icons[i],SwingConstants.CENTER));
            }
            jsp = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,true,scroller,cnl);
            jsp.setResizeWeight(0.4);
            contentPane.add(jsp,BorderLayout.CENTER);
            contentPane.add(topPanel,BorderLayout.NORTH);
            charTree.addMouseListener(new PopupListener());
            charTree.addTreeSelectionListener(cnl);
            charTree.setCellRenderer(new MyTreeRenderer());
            jpm = new JPopupMenu();
            JMenuItem addItem = new JMenuItem("Add");
            JMenuItem deleteItem = new JMenuItem("Delete");
            JMenuItem renameItem = new JMenuItem("Rename");
            addItem.addActionListener(new PopupItemListener());
            deleteItem.addActionListener(new PopupItemListener());
            renameItem.addActionListener(new PopupItemListener());
            jpm.add(addItem);
            jpm.add(renameItem);
            jpm.add(deleteItem);
            charTree.setSelectionPath(new TreePath(treeModel.getRoot()));
      }

      public static void main(String args[]){
            DNDJTree jtpm = new DNDJTree(args);
            jtpm.setSize(600,500);
            jtpm.setVisible(true);
      }

      private void showPMenu(int x, int y){
            jpm.show(this,x,y);
      }

       /*
       *
       * This method will add a number of children to the node passed in as the
       * first argument. The number of children will be a random number between
       * the min argument and 9. The children will have a random icon chosen from
       * icons array.
       *
       */

      private void addRandomChildren(DefaultMutableTreeNode node, int min){
            int minval;
            if (min > 9){
                  minval = 9;
            }else{
                  minval = min;
            }
            int numChildren = (int)(Math.floor(Math.random() * (9 - minval)) + minval);
            String s = ((JLabel)node.getUserObject()).getText();
            ImageIcon icon;
            for (int i = 1; i <= numChildren; i++){
                  icon = icons[(int)(Math.floor(Math.random() * (icons.length)))];
                  node.add(new DefaultMutableTreeNode(new JLabel(s + "." + i, icon, SwingConstants.LEFT)));
            }
      }

      /*
      *
      * This method creates and populates a DefaultTreeModel. The tree model
      * will have a root called "Root" and root will have the number of children
      * specified by the top argument. The TreeModel is then populated to the
      * specified depth argument by recursively calling the addRandomChildren() method.
      *
      */
      private DefaultTreeModel populateTree(int top, int depth){

            DefaultTreeModel treeModel;
            DefaultMutableTreeNode rootNode;
            DefaultMutableTreeNode firstNode;
            ImageIcon icon;
            icon = icons[(int)(Math.floor(Math.random() * (icons.length)))];
            rootNode = new DefaultMutableTreeNode(new JLabel("Root", icon, SwingConstants.LEFT));
            rootNode.removeAllChildren();
            for (int i = 0; i < top; i++){
                  icon = icons[(int)(Math.floor(Math.random() * (icons.length)))];
                  firstNode = new DefaultMutableTreeNode(new JLabel("Node " + i, icon, SwingConstants.LEFT));
                  rootNode.add(firstNode);
                  addRandomChildren(firstNode,3);
            }
            for (int j = 0; j < depth; j++){
                  DefaultMutableTreeNode leaf = new DefaultMutableTreeNode();
                  java.util.Enumeration e = rootNode.depthFirstEnumeration();
                  while (e.hasMoreElements()){
                        leaf = (DefaultMutableTreeNode)e.nextElement();
                        if (leaf.isLeaf()){
                              addRandomChildren(leaf,3);
                        }
                  }
            }
            treeModel = new DefaultTreeModel(rootNode);
            return treeModel;
      }

      /*
      *
      * Listens for clicks and checks to see if they are right-clicks.
      * If they are and they are on a TreeNode then the popup menu
      * is shown.
      */
      class PopupListener extends MouseAdapter{
            public void mouseClicked(MouseEvent me){
                  if (me.getModifiers() == me.BUTTON3_MASK){
                        JTree jt = (JTree)me.getSource();
                        TreePath tp = jt.getPathForLocation(me.getX(),me.getY());
                        if (tp != null){
                              jt.setSelectionPath(tp);
                              jpm.show(jt,me.getX(),me.getY());
                        }
                  }
            }
      }

      /*
      *
      * Listener for the items on the popup menu.
      * Contains the methods for adding, deleting and renaming nodes.
      *
      */

      class PopupItemListener implements ActionListener{
            public void actionPerformed(ActionEvent ae){
                  if (((JMenuItem)ae.getSource()).getText() == "Delete"){
                        int response = JOptionPane.showConfirmDialog(charTree,"Are you sure you want to delete this node ?", "Confirm Delete",JOptionPane.YES_NO_CANCEL_OPTION);
                        if (response == JOptionPane.YES_OPTION){
                              TreePath tp = charTree.getSelectionPath();
                              MutableTreeNode tn = (MutableTreeNode)tp.getLastPathComponent();
                              TreeNode tnp = (TreeNode)tn.getParent();
                              int[] idx = new int[]{((DefaultTreeModel)charTree.getModel()).getIndexOfChild(tnp,tn)};
                              ((DefaultTreeModel)charTree.getModel()).removeNodeFromParent(tn);
                              charTree.setSelectionPath(tp.getParentPath());
                        }
                        return;
                  }
                  if (((JMenuItem)ae.getSource()).getText() == "Rename"){
                        String response = JOptionPane.showInputDialog(charTree, "Enter new node name :","Rename Node", JOptionPane.PLAIN_MESSAGE);
                        if (response != null && response.length() != 0){
                              DefaultMutableTreeNode tn = (DefaultMutableTreeNode)charTree.getSelectionPath().getLastPathComponent();
                              JLabel jl = (JLabel)tn.getUserObject();
                              jl.setText(response);
                              ((DefaultTreeModel)charTree.getModel()).nodeChanged(tn);

                        }
                        return;
                  }
                  if (((JMenuItem)ae.getSource()).getText() == "Add"){
                        String response = JOptionPane.showInputDialog(charTree, "Enter new node name :","Add Node", JOptionPane.PLAIN_MESSAGE);
                        if (response != null && response.length() != 0){
                              ImageIcon icon = icons[(int)(Math.floor(Math.random() * (icons.length)))];
                              DefaultMutableTreeNode nn = new DefaultMutableTreeNode(new JLabel(response,icon,SwingConstants.LEFT));
                              DefaultMutableTreeNode tn = (DefaultMutableTreeNode)charTree.getSelectionPath().getLastPathComponent();
                              tn.add(nn);
                              ((DefaultTreeModel)charTree.getModel()).nodesWereInserted(tn, new int[]{tn.getChildCount()-1});
                        }
                        return;
                  }
            }
      }

      /*
      *
      * TreeCellRenderer for the JTree to show an Icon and a string.
      *
      */

      class MyTreeRenderer extends DefaultTreeCellRenderer{

            public Component getTreeCellRendererComponent(JTree tree,Object value,boolean sel,boolean expanded,boolean leaf,int row,boolean hasFocus){

                  super.getTreeCellRendererComponent(tree,value,sel,expanded,leaf,row,hasFocus);
                  if (((DefaultMutableTreeNode)value).getUserObject() instanceof JLabel){
                        JLabel jl = (JLabel)((DefaultMutableTreeNode)value).getUserObject();
                        this.setIcon(jl.getIcon());
                        this.setText(jl.getText());
                  }
                  return this;
            }
      }

      /*
      *
      * ListCellRenderer for the ChildNodeList to show an Icon and a string.
      *
      */

      class MyListRenderer extends DefaultListCellRenderer{

            public Component getListCellRendererComponent(JList list,Object value,int index,boolean isSelected,boolean cellHasFocus){
                  super.getListCellRendererComponent(list,value,index,isSelected,cellHasFocus);
                  if (((DefaultMutableTreeNode)value).getUserObject() instanceof JLabel){
                        JLabel jl = (JLabel)((DefaultMutableTreeNode)value).getUserObject();
                        this.setIcon(jl.getIcon());
                        this.setText(jl.getText());
                  }
                  return this;
            }

      }

      /*
      *
      * ChildNodeList listens for changes in the selection of the JTree and
      * changes in the TreeModel of the JTree and updates its list accordingly.
      * It is also a DropTargetListener and accepts drops from the icon panel.
      *
      */

      class ChildNodeList extends JList implements TreeModelListener, TreeSelectionListener, DropTargetListener{

            DropTarget dropTarget = null;
            DefaultMutableTreeNode lastTreeNode = null;
            TreePath lastTreePath = null;

            public ChildNodeList(){
                  super();
                  dropTarget = new DropTarget(this, this);
            }

            private void updateList(TreePath tp){
                  TreeNode tn = (TreeNode)tp.getLastPathComponent();
                  lastTreeNode = (DefaultMutableTreeNode)tn;
                  lastTreePath = tp;
                  Enumeration e = tn.children();
                  Vector v = new Vector();
                  while (e.hasMoreElements()){
                        v.add(e.nextElement());
                  }
                  setListData(v);
            }

            public void valueChanged(TreeSelectionEvent tse){
                  updateList(tse.getPath());
            }

            public void treeNodesChanged(TreeModelEvent tme){
                  updateList(lastTreePath);
            }

            public void treeNodesInserted(TreeModelEvent tme){
                  updateList(tme.getTreePath());
            }

            public void treeNodesRemoved(TreeModelEvent tme){
                  updateList(tme.getTreePath());
            }

            public void treeStructureChanged(TreeModelEvent tme){}

            public void dragEnter(DropTargetDragEvent dtde){
                  //System.out.println("Drag Detected at Target");
                  dtde.acceptDrag (DnDConstants.ACTION_MOVE);
            }

            public void dragExit(DropTargetEvent dte){}

            public void dragOver(DropTargetDragEvent dtde){}

            public void drop(DropTargetDropEvent dtde){
                  //System.out.println("Drop Detected at Target");
                  try {
                        Transferable transferable = dtde.getTransferable();
                        DataFlavor df = new DataFlavor(ImageIcon.class,"ImageIcon");
                        ImageIcon ti = (ImageIcon)transferable.getTransferData(df);
                        if (transferable.isDataFlavorSupported (df)){
                              dtde.acceptDrop(DnDConstants.ACTION_MOVE);
                              if (lastTreeNode != null){
                                    String response = JOptionPane.showInputDialog(this, "Enter new node name :","Add Node", JOptionPane.PLAIN_MESSAGE);
                                    if (response != null && response.length() != 0){
                                          DefaultMutableTreeNode nn = new DefaultMutableTreeNode(new JLabel(response,new ImageIcon(ti.getImage()),SwingConstants.LEFT));
                                          lastTreeNode.add(nn);
                                          treeModel.reload(lastTreeNode);
                                          updateList(lastTreePath);
                                    }
                              }
                              dtde.getDropTargetContext().dropComplete(true);
                              //System.out.println("Drop Complete at Target");
                        }else{
                              System.out.println("Bad data flavor.");
                              dtde.rejectDrop();
                        }
                  }catch (IOException exception){
                        exception.printStackTrace();
                        System.out.println( "IOException : " + exception.getMessage());
                        dtde.rejectDrop();
                  }catch (UnsupportedFlavorException ufException ){
                        ufException.printStackTrace();
                        System.out.println( "UnsupportedFlavorException : " + ufException.getMessage());
                        dtde.rejectDrop();
                  }
            }

            public void dropActionChanged(DropTargetDragEvent dtde){}
      }

      /*
      *
      * DraggableJLabel is a subclass of JLabel that is a DragSourceListener and
      * GragGestureListener. When dragged it triggers a drag using a TransferableIconImage
      * and a cursor corresponding to its own image.
      *
      */

      class DraggableJLabel extends JLabel implements DragSourceListener, DragGestureListener{

            DragSource dragSource = null;
            TransferableImageIcon ti;
            Window parent;

            public DraggableJLabel(Frame parent, String text, ImageIcon icon, int horizontalAlignment){
                  super(text,(Icon)icon,horizontalAlignment);
                  this.parent = parent;
                  ti = new TransferableImageIcon(icon.getImage(),text);
                  dragSource = new DragSource();
                  dragSource.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_MOVE, this);
            }

            public DraggableJLabel(Frame parent, ImageIcon icon, int horizontalAlignment){
                  super((Icon)icon,horizontalAlignment);
                  this.parent = parent;
                  ti = new TransferableImageIcon(icon.getImage(),"");
                  dragSource = new DragSource();
                  dragSource.createDefaultDragGestureRecognizer(this, DnDConstants.ACTION_MOVE, this);
            }

            public void dragDropEnd(DragSourceDropEvent dsde){
                  //System.out.println("Drop Complete at Source");
            }

            public void dragEnter(DragSourceDragEvent dsde){}

            public void dragExit(DragSourceEvent dse){}

            public void dragOver(DragSourceDragEvent dsde){}

            public void dropActionChanged(DragSourceDragEvent dsde){}

            public void dragGestureRecognized(DragGestureEvent dge){
                  //System.out.println("Drag Started at Source");
                  Toolkit tk = parent.getToolkit();
                  Cursor cursor = tk.createCustomCursor(ti.getImage(), new Point(0,0), "cursor");
                  dragSource.startDrag(dge, cursor, ti, this);
            }
      }

      /*
      *
      * A subclass of ImageIcon that implements Transferable so it can take part
      * in drag 'n' drop.
      *
      */

      class TransferableImageIcon extends ImageIcon implements Transferable{

            private DataFlavor df = new DataFlavor(ImageIcon.class,"ImageIcon");

            public TransferableImageIcon(Image i, String t){
                  super(i,t);
            }

            public Object getTransferData(DataFlavor flavor){
                  if (flavor.equals(df)){
                        return (Object)new ImageIcon(this.getImage(), this.getDescription());
                  }else{
                        return new Object();
                  }
            }

            public DataFlavor[] getTransferDataFlavors(){
                  DataFlavor[] dfArray = new DataFlavor[1];
                  dfArray[0] = df;
                  return dfArray;
            }

            public boolean isDataFlavorSupported(DataFlavor flavor){
                  if (flavor.equals(df)){
                        return true;
                  }else{
                        return false;
                  }
            }

            public String getText(){
                  return this.getDescription();
            }

            public Image getIcon(){
                  return this.getImage();
            }
      }
}
0
 
LVL 15

Expert Comment

by:ozymandias
ID: 6256771
Copy and paste all the code into one file called DNDJTree.java and then compile.

I have used JDK 1.3 and jikes as my compiler but it will work fine with javac.

I have added popup menus with add, rename and delete options on them. I know it's not part of your request but they were part of another question I was working on.

There is  SplitPane with the tree on the left (populated with random nodes) and the node list you asked for on the right.

The draggable icons are on a bar at the top.
You can drag them into the node list on the right and they will be added to the selected tree node on the left.

Let me know if you have any questions.
0
 
LVL 15

Expert Comment

by:ozymandias
ID: 6256785
PS : you may find that when you paste the code there are some line wraps that cause errors when you compile.

You just have to go through and correct them.
If you can't be bothered you can download the whole code file from :

http://ozymandias.webjump.com/dndjtree.java

Cheers.
0
 
LVL 15

Expert Comment

by:ozymandias
ID: 6259854
Partly because of my generosity and sense of public spirit and partly because I was curious, have extended my program so that you can now drop the icons directory on to the nodes of the tree as welll as dropping them on the node list.

Also, if you hover over a node for 4 seconds whilst dragging and icon, the node will automatically expand.

I hav also added on or two little fixes to the code above.
Nothing serious, there was just some uneccesary bits that were part of my experiment.

You can get the new, extended code here :

http://ozymandias.webjump.com/dndjtree2.java

0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 15

Expert Comment

by:ozymandias
ID: 6259862
Sorry, that should have been "directly" not "directory".
0
 

Author Comment

by:aravindmalai
ID: 6262162
Hi ozymandias
fine recieved ur code and got compiled and ts working but iprev i have mentioned something to be notified to u now
1) i told u to put the image icons on a pallette
2)and aslo u have sent the images in byte code and when i attempt it to use the images using that icons from alocal directory i was not able to do it indicate me of the changes
3) and also when i drop the icons in aparticular place it should be placed in that position only and after that we should provide with the rearrange option of the icons
when we select aparticular node i should be able to see the bit map image assocaiated with the node and the icons placed in the node and within the right pane i should be able to drag and drop and drop the icons within the different place i needed
4)i need to change the default cursor
5)also like in windows explore lines between the nodes should be provided (+,-)
if ur able to provide me with this ill give what u expect and above that iwth A grade
0
 
LVL 15

Expert Comment

by:ozymandias
ID: 6262193
1) What do you mean on a pallette. I do not know what that is.
2) Currently each ImageIcon is constructed by the following:

b = new byte{lots of bytes here};
icons[1] = new ImageIcon(b);

If you want to use files you just ditch the first line and write

icons[1] = new ImageIcon("imagefilename");

where "imagefilename" id the name of the jpg or gif you want to use.

3) You never mentioned this before. If was not pert of the original question. You will have to explain exactly what you mean.

4) When you say default do you mean you want the application to have a certain cursor all the time ? If so you do the following. At the end of the constructor create an ImageIcon as explained above and then create a cursor from it like so :

ImageIcon cursorIcon = new ImageIcon("mycursorimage.gif");
this.setCursor(getToolkit().createCustomCursor(cursorIcon.getImage(),new Point(0,0),"MyCursor"));

The Point you create is the co-ordinates of the image that will be the hotspot, e.g like the tip of the arrow cursor in windows. So you may need to adjust the values accordingly.

5) To make the JTree look like a windows tree you have to set the look and feel of the application to a windows look and feel and then increase the roww height of the JTree so that the icons will display properly. In our case I have used 24 pixel icons so I can set it to 24.

Add this code to the end of the constructor.

After the line :

charTree.setSelectionPath(new TreePath(treeModel.getRoot()));

add :

try{
  UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
  SwingUtilities.updateComponentTreeUI(this);
}catch (Exception e){
  System.out.println(e);
}
charTree.setRowHeight(24);

0
 

Author Comment

by:aravindmalai
ID: 6264250
following things iam not clear abt and u have to give suggestions
1) in swing ther is a layer called pallete which can hold icons (this is part of requirement first itself)
2)insted of using Jlist i think we can go for canvas so that when we drop the icons in aparticular place the icons should be there itself in the right pane  .and also i should be able to rearrange the icons to different postions and then should  be able to arrange  icons based on  shapes size etc
3)not able to read the icons from the local directory...
i tried out by deleting the byte codes and and passing iamge to constructor as u said above..but its not working
following said thing r part of the prev request do get back to me regarding this  
bye
0
 
LVL 15

Expert Comment

by:ozymandias
ID: 6264351
1) I cannot find any class in swing called palette or pallette. I do not know what you are talking about. If you don't like the way the icons are laid out or positioned you write a pallette class to hold them.

2) This was not part of your original question ! Being able to drop icons in a particular place and have them stay there, being able to rearrange them based on shape and size etc...none of it was in your original specification. Look back at your origial text if you need reminding !

What do you mean "WE can go for canvass" ? Where does WE come into it ! What exactly has your contribution been to this so far ?

3) Then you are doing it wrong. If you cannot load a simple ImageIcon from a file you should not even be attempting to write a Swing application as complex as this.
If you can't understand the code I'm writing for you then this whole process is counterproductive becuse you wont learn anything from it. You're not learning how to write code because you're not even trying. You are learning how to get other people to write code for you.

I have written a great deal of quite complex code for you which more than meets the requirements you laid out. I appreciate that you are new here but it is unacceptable for you to "move the goalposts" like this. What happens if I agree to write a pallete and a canvass for you ? Next you will say you want something else and then something else and so on and so on....all for a number of points which are insufficient to cover the original question. I only agreed to do this because you told me you didn't have any more points which cannot be true since you have only ever asked two questions and one of those cost you nothing.

I will not be taking further part in this and I will be speaking to the Topic Area Moderator about your behaviour.
0
 

Author Comment

by:aravindmalai
ID: 6264409
1)once again i want to remain u that the iamges should be placed on the icon is part of request one  u can go to my first request and see thwe word palette ok  
2) also abt the reading the icon from a local directory u only told to ignore the byte code and pass the iamge file in the constructor but u r now telling  something
3)as apart of 2nd request i asked u to provide the features like dropping the node in a particular place and arranging it for additional point that i have mentioned it clearly ..pl just go thru the comments and write to  me ..
iam very clear abt that palette layer its part of request from first itself..dont say that there is no layer called palette ..
and also iam very clear that in the introduction itself given Experts Exchange is to award points to the person whom if ia am satisfied fully only..crossing half river valley doesnt solve our purpose ..
and aslo iam still satisfied  with ur prev response (not last one u have made)and awas ready to garnt u want u require
0
 
LVL 15

Expert Comment

by:ozymandias
ID: 6264515
1) I thought you were using the word palette in the figurative sense since there is no class called palette ! You did not say "palette layer" anywhere in your request. There is a PALETTE_LAYER that is part of JDesktopPane and JLayeredPane but neither are suitable for what you want. If you are so sure about this palette perhaps you would provide an example and I will see if it can be incorporatde into my code.

2) I'm not going to discuss this with you any further. If you are unable to create an ImageIcon by using the code I posted above with a simple constructor like :

ImageIcon i = new ImageIcon("filename");//where file name is the name of the gif file

Then even discussing it with you is a pointless waste of time.

3) What do you mean 2nd request. You only get 1 request per question ! Here is the text of your request :

<quote>
ok i have increased the points to 150 u now provide me th code with the following feutures
a)logical tree nodes and when i click the following node in the left handside it should display the
coreesponding tree subnodes
b)also u should provide an icon pallette(from the menu bar) where i should be able to drag and drop
that icon to that right pane and it should be added to that particular node
3) particularly i should ba able to drag and drop the icon..
4) dfault cursor should be changed
if u provide me with this ill award 150 points with A grade
send me as soon as possible
</quote>

Where in that request does it say anything about the positioning of the dropped icon ? I did exactly as you asked !



0
 
LVL 3

Expert Comment

by:modder
ID: 6264553
Hello aravindmalai,

When you ask a question, and you get a correct answer, you should accept our expert's input.

If you then need further questions, you can ask a new question for the extra information.

You can't ask one question, and then just keep asking for more and more information in one and the same question, without ever rewarding anyone for their input.

modder
Community Support Moderator@Experts-Exchange
0
 

Author Comment

by:aravindmalai
ID: 6264560
for the positioning of icons only i told u that ill award extra points..if ur not interested mean pl leave off ok..ill give points to people who really provides me solution that satisfies my requirement ..i also went thru r
profile..noteven a single person has provide points greater than 30 for u ..i accept ist a complex application but awarding 150 points is more than enough for u..
0
 
LVL 15

Expert Comment

by:ozymandias
ID: 6264586
<quote>
profile..noteven a single person has provide points greater than 30 for u ..i accept ist a complex application but awarding 150 points is more than enough for u..
</quote>

Those point values are what the PAQs are worth. They are 10% of the original value. A 30 point question in my profile means that the original question was worth 300 !

You didn't even mention icon positioning until AFTER I had provided the code. If I had known about it before, I would not have undertaken the question for 150 points because it makes the whole thing a hell of a lot more complicated.
0
 
LVL 3

Expert Comment

by:modder
ID: 6264601
[removed insult] - modder
0
 

Author Comment

by:aravindmalai
ID: 6264610
[removed by modder], much ok ill give point only if iam satisfied ..let me see .......
bye
0
 
LVL 3

Expert Comment

by:modder
ID: 6264646
stop insulting each other

mo(th)er
0
 
LVL 3

Expert Comment

by:modder
ID: 6264686
OK. I've read the question.

aravindmalai,

What you're asking for is an "icon pallet"

This sounds like a panel of icons.

ozymandias addressed this request in his comment of 07/05/2001 11:18AM PST

Since that seems to have been the only point of dispute, it is clear that ozymandias should be given the points, and since it is equally clear that you're not willing to oblige, I have no choice but to accept this question on your behalf.

I do resent having to come in and do this. I have decided to increase the points to 200 to address this attitude. If you can post a comment here to apologise, and to reassure me that you can participate in experts-exchange in a constructive manner according to the guidelines set out in the member agreement, a link to which you can find at the bottom of every page, you can have those extra 50 points back.

Regards

modder
Community Support Moderator@Experts-Exchange
0
 

Author Comment

by:aravindmalai
ID: 6265403
Helo Modder
Felt very bad of this ,as a part of my request in th beginning itself u can see the icon palette

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Hi
this application is just like the windows explorer and when evr i i click the icon from the tree view

the right handside the corresponding subnodes r displayed ....and it goes on like that...
what i have to do is i have to drag one icon from an icon pallet (which will be in menubar) and drop
.........................................
in the right pane and it should be added to that particular top level node ..do explain with me codings....
both the drag drop should be in the same window >>>>>>>>>>>>>>>>>>>>>>

u  can see that the icon pallet on the description istself ima n ot the person to lie..........
morover he has given the icons as byte code as instructed by him i tried to read an icon from my local directory ..
but i was not able to drag and drop the icon ..
this u have to seriously note it and get me an solution...and he is scolding me cooly as idiot (he only started using unparliamantry words )
as a extra request i aslo assured him that ill provide extra pints with A grade u can also see that in the comments added
still my requirement is not complete(first requirement )
how cum u can award him points ???? \
**** icons r not draggable once ithe icons r read from local directory.....
ask hime to give suitable solution for rhis
0
 

Author Comment

by:aravindmalai
ID: 6272845
Helo modder
i want to again take part in the discussion and continue to be in the forum what i need to do ..
ask ozymanidas to get back to me
ill follow the agreements
expecting ur reply in this regard
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The viewer will learn how to implement Singleton Design Pattern in Java.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now