Hi David,
Thanks for the prompt reply .. i would be glad to receive a reply soon as
this is very urgent.
The drag and drop are from
buttons - frame (add a split pane),
tree to table,
and table to panel(to draw a graph).
public void drop(DropTargetDropEvent event) {
try {
Transferable transferable = event.getTransferable();
event.acceptDrop(DnDConstants.ACTION_MOVE);
String s = (String)
transferable.getTransferData(DataFlavor.stringFlavor);
// we accept only Strings
if
(transferable.isDataFlavorSupported(DataFlavor.stringFlavor)) {
if (s.indexOf("btn") >= 0) //drag from a button {
frame.addPanelToSplitPane((Igraph)
panelName(s)); //add a panel to a split pane
} else
if (s.indexOf("treeITCC") >= 0) { //drag
from tree
//System.out.println("in index of
tree");
java.util.ArrayList arrLst =
getAllCity();
for (int i = 0; i < arrLst.size();
i++) {
frame.getMarketValue1().addRow((String) arrLst.get(i)); //adding a row to a
table
}
} else
if (s.indexOf("Table") >= 0 &&
event.getDropTargetContext().getComponent().getName().indexOf("Graph_Min_Buy
") >= 0) { // drag from table
java.util.ArrayList arrLst =
getSelectedCarriersFromTable();
for (int i = 0; i <
arrLst.size(); i++) {
if
(!isCarrierAlready(event, (String) arrLst.get(i)))
((Igraph)
event.getDropTargetContext().getComponent()).addGraph((String)
arrLst.get(i), new
Color((float)Math.random(),(float)Math.random(),(float)Math.random()));
//calling a method addGraph to add a carrier for the graph on panel
}
}
} else {
event.rejectDrop();
}
} catch (Exception e) {
}
Hope u can find a solution
I've sent the code for drop method .. but what I feel is that drop targets
r'nt getting registered as any System.out.println statements in the drop
method r'nt getting executed at all ..
Pls help,
Thanks,
==========
Divya Seth
Java Developer
For and on behalf of
ITCC
P.O Box - 74500
Dubai (UAE)
Phone : +971-4-3303778
Fax : +971-4-3303779
Email : [EMAIL PROTECTED] <mailto : [EMAIL PROTECTED]>
Website : www.ITClearingCorp.com
_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing