Multiple DnD in JTreeTable

Hi Folks--
two weeks ago I started to implement Drag and Drop for my wonderful TreeTableComponent, that is based on a JTreeTable described in an article by sun. It didn't took me long to figure that dnd is not the easiest thing to do for a JTreeTable. So I browsed this forum and found many other people who have or had the same problem. Since the given answers didn't help me so much, I thought it would be good to publish my implementation here:
After two weeks I managed to implement dnd in the right way (as I belive). Here's my solution.
1. disable internal dnd function by setDragEnabled(false)
2. set your own transfer handler that manages dnd for you (derive from TransferHander or simply create an instance of TransferHandler)
3. add a mouse listener and a mouse motion listener to your treeTable to tell the transfer handler to start the drag
4. revert order of mouse listener that you mouse listener is called first -> this is importent to keep selection on all previously selected nodes (prevents internal mouse handler of tree changing selection to the node you just clicked onto)
5. set selection mode of table and tree to make multiple selection possible to the user
add this where you init the table:
('table' is instance of a JTreeTable derivative)
        //disable internal dnd functionality, because we need our own implementation
        table.setDragEnabled(false); 
       //attach transfer handler
        table.setTransferHandler(createTransferHandler());
        //since we have a transfer handler, we just need to attach mouse listeners
        //to initiate the drag inside of the transfer handler
        DnDMouseAdapter dndMouseAdapter = new DnDMouseAdapter();
        table.addMouseListener(dndMouseAdapter);
        table.addMouseMotionListener(new DnDMouseMotionAdapter());
        //revert MouseListeners order so that our MouseListener is called first
        //this is important to give drag n drop first priority and prevent the
        //internal mouse handler of tableUI changing the selection.
        MouseListener[] mls = table.getMouseListeners();
        for (int i = 0; i < mls.length; i++) {
            if (mls[i] != dndMouseAdapter) {
                table.removeMouseListener(mls);
table.addMouseListener(mls[i]);
//set multiple selection
table.getSelectionModel().setSelectionMode(getSelectionMode());
//set selection mode for tree
final JTree tree = getTreeTable().getTree();
tree.getSelectionModel().setSelectionMode(TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION);
The idea for the mouse listeners I got from sun's swing tutorial. So here's the code for dndMouseAdapter and dndMouseMotionAdapter:
  class DnDMouseAdapter extends MouseAdapter {
        public void mousePressed(MouseEvent e) {
            firstMouseEvent = e;
            e.consume();
        public void mouseReleased(MouseEvent e) {
            firstMouseEvent = null;
    class DnDMouseMotionAdapter extends MouseMotionAdapter {
        //define diplacement of five pixel for as drag
        private static final int PIXEL_DISPLACEMENT = 5;
        public void mouseDragged(MouseEvent e) {
            if (firstMouseEvent != null) {
                e.consume();
                //if the user holds down the control key -> COPY, otherwise MOVE
                int ctrlMask = InputEvent.CTRL_DOWN_MASK;
                int action = ((e.getModifiersEx() & ctrlMask) == ctrlMask) ? TransferHandler.COPY : TransferHandler.MOVE;
                int dx = Math.abs(e.getX() - firstMouseEvent.getX());
                int dy = Math.abs(e.getY() - firstMouseEvent.getY());
                //define a displacement of at least some pixel as a drag
                if (dx > DnDMouseMotionAdapter.PIXEL_DISPLACEMENT || dy > DnDMouseMotionAdapter.PIXEL_DISPLACEMENT) {
                    //starting to drag...
                    JComponent c = (JComponent) e.getSource();
                    TransferHandler handler = c.getTransferHandler();
                    //tell transfer handler to start drag
                    handler.exportAsDrag(c, firstMouseEvent, action);
                    //reset first mouse event for the next time
                    firstMouseEvent = null;
    }I hope that helps! ;-)
Any comment is apprechiated!
Kind regards,
Patrick

I'm absolutetly devastated!!
I spent hours looking for advice on a treetable component after someone mentioned the idea not too long ago, in another thread might I add.
And I just spent the last 2 damn weeks implementing myy own. I feel heart broken! JTreeTable v1 was even very similar tomy first bash...but I gave on using the JTree as the renderer as it just looked lame... the way I did it anyway.
So just today I finished my own impl, with a new JComponent derivative soley for the rendering of the tree-like column.
Any clue as to when they intend to make it a standard JFC Swing component.
Bloody marvelous! So annoyed as it was a serious road-block to my current project! And asmuch as it was fun, I didn't choose to do for fun. AAAAAAARRRGGH!!
ps. congratulations, if you feel at all like how I felt half an hour ago, you must be very chuffed.

Similar Messages

  • Does JTree support multiple DnD?

    I'm working on an applet which displays a JTree tree, which has to support multiple DnD.
    i mean, user has to be capable of selecting several nodes at a time and drag all of them, dropping them into a target.
    Though i have asked about it, and somebody told me about it, the solution was with a JFrame, and all the examples which work and i've read, arre with JFrame.
    So i guess that maybe JTree does not support multiple DnD, and moreover, there is a website
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4165577
    in which someone says that, in fact, JTree does not support it. But it's and old page, so i want to know if at present, Jtree still has this debug.
    Thanks in advance!

    http://www.java-forum.org/de/viewtopic.php?p=139820#139820

  • Multiple DataControls - oracle.bali.xml.model.XmlInvalidOnCommitException

    I have an ADF BC/Faces application with 2 model projects, each having their own app module so I can connect to 2 different schemas for different pages. I am seeing multiple data controls appear in the DC palette - why? In DataBindings.cpx there are only 2 data controls.
    For example, I just added a new view to one AM. It appeared in the DC palette under a new DataControl (AppModuleDataControl3) instead of in the existing DataControl for that AM. When I dragged from the view to the page, I got "could not complete findOrCreateDataControlInApplication because it would result in an invalid document." The full error is below.
    The only unusual thing I can think of is that I am using AM configurations with JDBC DataSource for the connection type. My Jdev version is 10.1.3.3.
    oracle.bali.xml.model.XmlInvalidOnCommitException: SEVERE: Required attribute Configuration missing from element BC4JDataControl [ node = BC4JDataControl ]
    <dataControlUsages>
    <BC4JDataControl id="AppModuleDataControl" Package="com.guideworkstv.ibo.model" FactoryClass="oracle.adf.model.bc4j.DataControlFactoryImpl" SupportsTransactions="true" SupportsFindMode="true" SupportsRangesize="true" SupportsResetState="true" SupportsSortCollection="true" Configuration="AppModuleLocal1" syncMode="Immediate" />
    <BC4JDataControl id="WebStageAppModuleDataControl" Package="com.guideworkstv.ibo.webstagemodel" FactoryClass="oracle.adf.model.bc4j.DataControlFactoryImpl" SupportsTransactions="true" SupportsFindMode="true" SupportsRangesize="true" SupportsResetState="true" SupportsSortCollection="true" Configuration="WebStageAppModuleLocal1" syncMode="Immediate" />
    <BC4JDataControl id="AppModuleDataControl3" Package="com.guideworkstv.ibo.model.webstage.entities" FactoryClass="oracle.adf.model.bc4j.DataControlFactoryImpl" SupportsTransactions="true" SupportsFindMode="true" SupportsRangesize="true" SupportsResetState="true" SupportsSortCollection="true" syncMode="Immediate" />
    </dataControlUsages>
         at oracle.bali.xml.model.XmlModel._validateSubtree(XmlModel.java:3353)
         at oracle.bali.xml.model.XmlModel._validateDocument(XmlModel.java:3264)
         at oracle.bali.xml.model.XmlModel.__precommitTransaction(XmlModel.java:2684)
         at oracle.bali.xml.model.XmlContext.__precommitTransaction(XmlContext.java:1519)
         at oracle.bali.xml.model.XmlContext.__commitTransaction(XmlContext.java:1549)
         at oracle.bali.xml.model.XmlModel.__requestCommitTransaction(XmlModel.java:2717)
         at oracle.bali.xml.model.XmlModel.commitTransaction(XmlModel.java:575)
         at oracle.bali.xml.model.XmlModel.commitTransaction(XmlModel.java:555)
         at oracle.bali.xml.model.task.StandardTransactionTask.__commitWrapperTransaction(StandardTransactionTask.java:413)
         at oracle.bali.xml.model.task.StandardTransactionTask.runThrowingXCE(StandardTransactionTask.java:203)
         at oracle.bali.xml.model.task.StandardTransactionTask.run(StandardTransactionTask.java:98)
         at oracle.adfdt.jdev.transaction.JDevTransactionManager.runTaskUnderTransaction(JDevTransactionManager.java:61)
         at oracle.adf.dt.managers.ApplicationManager.findOrCreateDataControlInApplication(ApplicationManager.java:572)
         at oracle.adf.dt.managers.IteratorManager.initializeIteratorBindingProperties(IteratorManager.java:419)
         at oracle.adf.dt.managers.IteratorManager.createIteratorInstance(IteratorManager.java:401)
         at oracle.adf.dt.managers.IteratorManager.findOrCreateIterator(IteratorManager.java:245)
         at oracle.adf.dt.dbpanel.DataBindingManager$2.run(DataBindingManager.java:965)
         at oracle.adfdt.jdev.transaction.JDevTransactionManager$3.performTask(JDevTransactionManager.java:116)
         at oracle.bali.xml.model.task.StandardTransactionTask.runThrowingXCE(StandardTransactionTask.java:167)
         at oracle.bali.xml.model.task.StandardTransactionTask.run(StandardTransactionTask.java:98)
         at oracle.adfdt.jdev.transaction.JDevTransactionManager.fetchUnderTransaction(JDevTransactionManager.java:110)
         at oracle.adf.dt.dbpanel.DataBindingManager.findOrCreateIteratorBinding(DataBindingManager.java:986)
         at oracle.adf.dt.dbpanel.DataBindingManager$1.run(DataBindingManager.java:1033)
         at oracle.adfdt.jdev.transaction.JDevTransactionManager$3.performTask(JDevTransactionManager.java:116)
         at oracle.bali.xml.model.task.StandardTransactionTask.runThrowingXCE(StandardTransactionTask.java:167)
         at oracle.bali.xml.model.task.StandardTransactionTask.run(StandardTransactionTask.java:98)
         at oracle.adfdt.jdev.transaction.JDevTransactionManager.fetchUnderTransaction(JDevTransactionManager.java:110)
         at oracle.adf.dt.dbpanel.DataBindingManager.createControlBinding(DataBindingManager.java:1111)
         at oracle.adf.dt.dbpanel.DataBindingManager.createControlBinding(DataBindingManager.java:996)
         at oracle.adfdt.view.common.binding.utils.ADFBindingUtils.createControlBinding(ADFBindingUtils.java:99)
         at oracle.adfdtinternal.view.faces.binding.provider.ADFIteratorModelProvider.getTableBinding(ADFIteratorModelProvider.java:338)
         at oracle.adfdtinternal.view.faces.binding.provider.ADFIteratorModelProvider.getIteratorBindingExpression(ADFIteratorModelProvider.java:83)
         at oracle.adfdtinternal.view.faces.binding.binder.ADFCustomTableBinder.bind(ADFCustomTableBinder.java:78)
         at oracle.adfdtinternal.view.common.binding.creator.XmlBasedCreatorInfo._bindDocumentFragment(XmlBasedCreatorInfo.java:483)
         at oracle.adfdtinternal.view.common.binding.creator.XmlBasedCreatorInfo.createDocumentFragment(XmlBasedCreatorInfo.java:257)
         at oracle.adfdtinternal.view.common.binding.datatransfer.ADFDocumentFragmentCreatorInfo.createDocumentFragment(ADFDocumentFragmentCreatorInfo.java:76)
         at oracle.adfdtinternal.view.common.binding.operation.CreateOperation.apply(CreateOperation.java:96)
         at oracle.bali.xml.model.datatransfer.operation.PerformOperationAction.actionPerformed(PerformOperationAction.java:39)
         at oracle.bali.xml.share.ActionProxy.actionPerformed(ActionProxy.java:47)
         at oracle.bali.xml.gui.swing.dnd.DropMenuInvoker$CleanupProxy.actionPerformed(DropMenuInvoker.java:235)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
         at javax.swing.AbstractButton.doClick(AbstractButton.java:302)
         at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1000)
         at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1041)
         at java.awt.Component.processMouseEvent(Component.java:5488)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
         at java.awt.Component.processEvent(Component.java:5253)
         at java.awt.Container.processEvent(Container.java:1966)
         at java.awt.Component.dispatchEventImpl(Component.java:3955)
         at java.awt.Container.dispatchEventImpl(Container.java:2024)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
         at java.awt.Container.dispatchEventImpl(Container.java:2010)
         at java.awt.Window.dispatchEventImpl(Window.java:1774)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

    This issue was caused by an import of a reusable library of business components which contained app modules. In the application where I maintain the BC library, I created app modules so I could verify the model before using it in other applications.
    From looking at the .jpx files for my models it appears that these app modules
    were imported as part of the library. So I removed the app modules and corrected my .jpx files.
    I'd suggest a note be added to the section about reusable BC libraries to make sure that any test app modules are excluded when jar files are generated.

  • Custom Renderers in JTreeTable (or extending JTable)?

    I am wondering about what the best approach is to display a table in a Swing component. My table will by default have all rows collapsed (occupying a single line), but someone may click on a row to expand it (so it occupies multiple lines and displays more information). Nothing in the table should be editable.
    Example:
    (collapsed) 1. data     data     data
    (expanded) 2. data     data     data
    ...more data that wouldn't fit on on one line...
    ... still more data (additional data doesn't have same column format as collapsed rows)...
    (collapsed) 3. data     data     dataSo the additional data displayed when a row is expanded aren't conceptually `children' of the data in the collapsed display. I've looked at JTreeTable, but I'm not sure it's right for this purpose, and it seems complicated.
    For one thing, I need some of my columns to have custom renderers--for example, renderers that display a button with text or an image instead of just a label. However, it looks like the JTreeTable approach forces you to declare the JTree (extension) as the renderer of everything in a row, so would that prevent me from specifying custom renderers for other columns, or am I misunderstanding?
    Another feature I need is to be able to filter out entire rows from the view (so they don't show up at all). I will also want to add custom sort buttons that can apply four different sorts to each column.
    Would I be better off using a JTreeTable for this or somehow using custom renderers or otherwise extending an ordinary JTable to make the column larger and display additional information when the user clicks the expand icon?
    Also, how do I specify a different renderer for header rows than for other rows?
    Message was edited by:
    The.Joy.of.Java

    Check how editingStopped is being done. For a ComboBox there is no common operation that one can assume means that the user is done with the editing component. By default JTable leaves it active until the mouse clicks somewhere outside it, then does, essentially, fireEditingStopped() to give the cell back to the renderer. Then a second mouse click is required to start a new cell editor.
    If you're using ComboBox as a custom editor, you have to decide what event you want to be final and call fireEditingStopped() yourself. For instance, in your TableCellEditor:
        @Override
        public Component getTableCellEditorComponent(final JTable table,
                                                     final Object value,
                                                     final boolean isSelected,
                                                     final int row,
                                                     final int column) {
    ...             if( editor.supportsCustomEditor() )  {
                        JComboBox c = (JComboBox)editor.getCustomEditor();
                        c.removeActionListener( this );
                        c.addActionListener( this );
                        return c;
        @Override
        public void actionPerformed ( final ActionEvent ev ) {
            else if( "comboBoxChanged".equals( ev.getActionCommand() ) )  {
                fireEditingStopped();
        }The actionEvent is fired when just about anything happens in the ComboBox, including selection of the currently selected item. But unless you have a more specific requirement, it should be good enough.

  • Drag and Drop of multiple components at once

    Hi everybody,
    I need to select and drag multiple components (Eg. JLabels) at once, it is quite simple to manage just one drag at a time but how can be managed a multiple drag?
    I mean something like Windows files selection mechanism : using Ctrl + Left mouse click to select the components and then start dragging them all to the drop target.
    Beneath the code I'm using for testing , clicking and dragging each JLabel to JTextField just cause the copy of JLabel text to the JTextField contents.
    In the sample a left click on each displayed label sets a border just to identify the selected status of the labels to drag but there's no implementation of the drop mechanism that should copy all the selected JLabels text to the drop target (the JTextField).
    import java.awt.Dimension;
    import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseListener;
    import java.util.HashMap;
    import javax.swing.BorderFactory;
    import javax.swing.JComponent;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JTextField;
    import javax.swing.TransferHandler;
    import javax.swing.UIManager;
    import javax.swing.border.Border;
    import javax.swing.border.CompoundBorder;
    import javax.swing.border.EmptyBorder;
    public class SelectableJLabel extends JPanel {
      MouseListener listener = new DragMouseAdapter();
      public Border getBorder(boolean getSelectedBorder) {
        Border outsideBorder = BorderFactory.createEmptyBorder(2,2,2,2);
        Border insideBorder = BorderFactory.createEmptyBorder(2,2,2,2);
        if (getSelectedBorder)
          insideBorder = BorderFactory.createEtchedBorder();
        return BorderFactory.createCompoundBorder(outsideBorder, insideBorder);
      private class DragMouseAdapter extends MouseAdapter {
        public void mousePressed(MouseEvent e) {
          System.out.println("Press!");
          JComponent c = (JComponent) e.getSource();
          JLabel lbl = (JLabel)c;     
          if (lbl.getBorder()==null || ((CompoundBorder)lbl.getBorder()).getInsideBorder() instanceof EmptyBorder) {
            lbl.setBorder(getBorder(true));
            TransferHandler handler = c.getTransferHandler();
            handler.exportAsDrag(c, e, TransferHandler.COPY);    
          } else
            lbl.setBorder(getBorder(false));        
        /* (non-Javadoc)
         * @see java.awt.event.MouseAdapter#mouseClicked(java.awt.event.MouseEvent)
        @Override
        public void mouseClicked(MouseEvent e) {
      public JLabel getSelectableLabel() {
        JLabel selectableJLabel = new JLabel("You can't select me");
        selectableJLabel.setBorder(getBorder(false));
        selectableJLabel.setTransferHandler(new TransferHandler("text"));
        selectableJLabel.addMouseListener(listener);
        return selectableJLabel;
      public SelectableJLabel() {
        // a regular JLabel
        add(getSelectableLabel());
        add(getSelectableLabel());
        add(getSelectableLabel());
        // a look-alike JLabel
        JTextField f = new JTextField("You can select me........................");
        f.setDragEnabled(true);
        //f.setEditable(false);
        f.setBorder(null);
        f.setForeground(UIManager.getColor("Label.foreground"));
        f.setFont(UIManager.getFont("Label.font"));
        add(f);
      public Dimension getPreferredSize() {
        return new Dimension(100, 100);
      public static void main(String s[]) {
        JFrame frame = new JFrame("SelectableJLabel");
        SelectableJLabel panel = new SelectableJLabel();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.getContentPane().add(panel, "Center");
        frame.setSize(panel.getPreferredSize());
        frame.setVisible(true);
    }Tnx in advance for HELP
    Massimo
    Edited by: JKut on May 2, 2010 10:48 AM

    For multiple selections I recommend to use "JList". The "ListTransferHandler" provided in the "DropDemo" sample code supports multiple selections: [http://java.sun.com/docs/books/tutorial/uiswing/dnd/dropmodedemo.html]. To enable MULTIPLE_INTERVAL_SELECTION, simply remove the following statement in the "DropDemo" class:
            list.setSelectionMode(ListSelectionModel.SINGLE_INTERVAL_SELECTION);

  • DND in the same JTable (rows)

    Hi,
    First, sorry for my english, I come from Montral, Quebec, so my mothertongue is French! But I feel good to read in English.
    I my project, I have to implement Drag n drop in the same JTable, that contain just String elements (In fact, my JTable works like a ListView in C).
    It seems like my JTable can be a Drag Source or a Drop destination, but not both for the same dnd operation. I would like to select some rows(not columns) and change the index of those rows with a drag n drop operation.
    Is it possible?
    thk
    Simon

    Hi,
    It is possible to drag n drop the Objects within the table. The following sample code deals with single transfer and interchange the data between the rows. Pls. use the MultipleTransfer for multiple Object Drag n drop.
    public class TableDND extends JTable implements DropTargetListener,DragSourceListener, DragGestureListener {
    //JTable methods
    //DND methods
    private int mRow; // remember the row where the drag Started
    private int mColumn; // remember the Column where the drag Started
    private Object mDataToSet; // remember the data where the drag Started
    public void dragDropEnd(DragSourceDropEvent dsde) {
              // TODO Auto-generated method stub
    ((DefaultTableModel)getModel()).setValueAt(mDataToSet,mRow,mColumn);
    public void dragGestureRecognized(DragGestureEvent dge) {
              // TODO Auto-generated method stub
    Point pt = dge.getDragOrigin();
    mRow = rowAtPoint(pt);
    mColumn = columnAtPoint(pt);
    Object obj = getValueAt(mRow,mColumn);
    StringSelection transferData = new StringSelection(obj.toString());
    mDragSource.startDrag(dge,DragSource.DefaultMoveDrop,transferData, this);
    public void drop(DropTargetDropEvent dtde) {
              // TODO Auto-generated method stub
    try {
    Point p = dtde.getLocation();
    int row = rowAtPoint(p);
    int column = columnAtPoint(p);
    mDataToSet = getValueAt(row,column);
                   Transferable transferData = dtde.getTransferable();
                   Object data = transferData.getTransferData(DataFlavor.stringFlavor);
    ((DefaultTableModel)getModel()).setValueAt(data,row, column);
              } catch (Exception e) {
    Have a nice time.
    regards
    Kamal
    Hi,
    First, sorry for my english, I come from Montral,
    Quebec, so my mothertongue is French! But I feel good
    to read in English.
    I my project, I have to implement Drag n drop in the
    same JTable, that contain just String elements (In
    fact, my JTable works like a ListView in C).
    It seems like my JTable can be a Drag Source or a Drop
    destination, but not both for the same dnd operation.
    I would like to select some rows(not columns) and
    change the index of those rows with a drag n drop
    operation.
    Is it possible?
    thk
    Simon

  • Dynamic height of rows in JTreeTable

    Hi,
    I use a JTreeTable. In the fourth colum is text with multiple rows (I used a textarea internally), that means the height of the row has been expanded. Unfortunately the height of each row of the JTreeTable is default (16 px) so the cell of the first colum (the colum with the tree) shows two and a half nodes if the cell of the fourth colum has text in three rows. I prefer only one node per row (top aligned) and the next node one row below AND the dashed lines has to be larger...
    Can anyone help me??
    Thank you!

    No, that is not the answer.
    The height of the row of the table is set dynamically. Means, if the width of the colum is 130 px and the text is larger, so four rows per text needed, the height of the row is set to (4*textarea.getPreferredWidth().height +2). It works!!
    My problem is, that I cannot set the height of the treenodes independently from each other. In other words, I need a way to set the gap between nodes and to extend the dashed lines.
    Example:
    Root
    |
    |--Node1
    |
    |--Node2
    |
    |
    |
    |
    |--Node3

  • Multiple Item Drag and Drop

    I'm working on an application where I need multiple item DnD between JTrees and JTables. I'm using Java 1.4.1
    I have the basics of multiple item DnD working, by creating Transferable classes that contain a collection of items.
    The problem I have is when I drag a multiple selection within a JTree (i.e. DragSource and DropTarget are the same) then my call to event.getCurrentDataFlavors() in my dragOver(DropTargetDragEvent event) method is not returning any data flavours unless I drag over to another JTree. If I now drag back over to the source JTree (so that DragSource and DropTarget are again the same) as if by magic I now get DataFlavours whilst dragging over the source container.
    This is driving me nuts! :-)
    Has anybody else seen this and do they have a solution?

    I have the same problem here.
    When I try to perform drag and drop in a JTree (DragSource and DropTarget are the same), calling event.getCurrentDataFlavors() in the dragOver(DropTargetDragEvent event) method in the DropTargetListener returns me nothing!!
    However, the call of event.getCurrentDataFlavors() in the
    drop(DropTargetDropEvent event) does return me the correct
    information.
    On the doc, the DropTargetDragEvent.getCurrentDataFlavors()
    should mimic DropTargetDropEvent.getCurrentDataFlavors().
    So, I suppose both functions should work in the same way
    properly.
    Is there anything wrong with my understanding or is that a bug
    of the Java dnd?

  • Multiple Computer question

    hi there
    i just bought an iPod Video... 30Gb....
    i have a PowerBook G4, and my Bro a WinXp desktop....
    i first plugged the iPod to my PB, but i'd like to plug it to my bro's PC to sync some other songs, and also transfer 'big files' using iPod as external driver... (need to transfer 20 Gigs)
    I read the Apple Article about 'Multiple Computers' but... is the final answer 'yes' or 'no' ?
    They mention something about formating again the entire iPod... but isn't it possible to have the iPod loaded with pictures and music and use it to copy and transfer files and sync iTunes songs just as if it were an external hard disk?
    If i am not wrong, what i can understand / interpret from that article is that one cannot do what i have just described without re-formatting.... can i just plug to win and mac back and forth??

    Hello guys...
    today i plugged my iPod (bought few days ago) to my Mac...
    then transferred some pics and songs... just a few to test...
    then i plugged it into a WinXP...
    i installed the iPod's CD SW before...
    then i followed the instructions and then the iPod was on "Do Not Disconnect" for more than 40 minutes...
    then this was not yet detected by iTunes...
    by the way, right after i installed the SW that came on CD, i followed the instructions on 'registering' i guess, and plugged the iPod according to the instructions... but then it just stayed there... flashing the DND message...
    then i opened it on Windows Explorer... nothing....
    i clicked the USB eject button, but it told me: 'it is used by another app' so i could not eject it...
    my question is:
    was this 're-formatting' for FAT 32????
    does it take that long? (the PC has usb 2.0 but doesnt have the driver or the SP2 to run it as usb 2.0... )
    then i just chose to format the disk, "fast format" mode... it ended... but still "DND" message... so i just shut down the pc...
    then when i wanted to turn the iPod on there was this icon: 'folder with exclamation icon'.... and the apple.com/support/ipod link under it... so i went to read the articles... but i still don't know what happened or what was it doing.....
    now i am afraid of pluggin it to a pc... i had to plug it into my PB to 'restore the ipod'....
    can anyone help me find out what was the PC doing with my ipod, while flashing "DND" message?
    thanks a lot for ur info...

  • How do multiple family members use iTunes.? One account or multiple?

    How do multiple family members use iTunes. One account right now but apps gets added to all devices and iTunes messages go to all devices.  Can multiple accounts be setup and still have ability to share purchased items?

    Hey Ajtt!
    I have an article for you that can help inform you about using Apple IDs in a variety of ways:
    Using your Apple ID for Apple services
    http://support.apple.com/kb/ht4895
    Using one Apple ID for iCloud and a different Apple ID for Store Purchases
    You can use different Apple IDs for iCloud and Store purchases and still get all of the benefits of iCloud. Just follow these steps:
    iPhone, iPad, or iPod touch:
    When you first set up your device with iOS 5 or later, enter the Apple ID you want to use with iCloud. If you skipped the setup assistant, sign in to Settings > iCloud and enter the Apple ID you’d like to use with iCloud.
    In Settings > iTunes and App Stores, sign in with the Apple ID you want to use for Store purchases (including iTunes in the Cloud and iTunes Match). You may need to sign out first to change the Apple ID.
    Mac:
    Enter the Apple ID you want to use for iCloud in Apple () menu > System Preferences > iCloud.
    Enter the Apple ID you want to use for Store purchases (including iTunes in the Cloud and iTunes Match) in Store > Sign In. In iTunes 11, you can also click iTunes Store > Quick Links: Account.
    PC (Windows 8):
    Enter the Apple ID you want to use for iCloud in the Control Panel. To access the iCloud Control Panel, move the pointer to the upper-right corner of the screen to show the Charms bar, click the Search charm, and then click the iCloud Control Panel on the left.
    Enter the Apple ID you want to use for Store purchases (including iTunes in the Cloud and iTunes Match) in iTunes. In iTunes 10, select Store > Sign In. In iTunes 11, click iTunes Store > Quick Links: Account.
    PC (Windows 7 and Vista):
    Enter the Apple ID you want to use for iCloud in Control Panel > Network and Internet > iCloud.
    Enter the Apple ID you want to use for Store purchases (including iTunes in the Cloud and iTunes Match) in iTunes 10 in Store > Sign In. In iTunes 11, click iTunes Store > Quick Links: Account.
    Note: Once a device or computer is associated with your Apple ID for your iTunes Store account, you cannot associate that device or computer with another Apple ID for 90 days. Learn more about associating a device or computer to your Apple ID.
    Thanks for using the Apple Support Communities!
    Cheers,
    Braden

  • How do I move multiple dimension members up one level in planning?

    I can't figure out how to select multiple members.
    I hope I don't have to cut and paste them individually.

    ODI maybe ?
    Cheers
    John
    http://john-goodwin.blogspot.com/

  • How can I setup a mail-specific passcode/restriction on iPad used by multiple family members?

    How can I setup a mail-specific passcode/restriction on iPad used by multiple family members?
    Have an Exchange mail account setup and accessible in my mail on iPad... however my kids use it and i would like to restrict them from accessing this specific portion of the device.  I tried viewing restriction options and do not see that i can apply a restriction specifically to Mail.  Thanks for your help.

    Not a feature of iOS. Check the AppStore to see if there are other
    mail apps that allow passcode protection.
    Or use Safari to log onto your email via a web-based interface and
    enter your credentials each time. A bit slower, but the kids will
    not know the details to login.

  • How can a family with multiple existing accounts use Home Sharing?

    I'd like to use the new Home Sharing feature, but it appears to be restricted to families in which all of the family members share a single user account.
    We already have separate accounts for each family member. Is there some way for us to use Home Sharing without abandoning most of our existing accounts, along with all of the purchases made by those accounts? I don't think anyone in this situation would be willing to do that.

    Eh. I am not too sure since I have not messed with it much but I do have a great deal of experience with multiple accounts. Each computer can be authorized for multiple accounts. As can iPods. iPods can sync songs/videos/apps from multiple accounts as long as the computer is authorized with them. What I have set up here, is I buy my stuff I want, my parents buy what they want and so do my brothers. When my bro gets something I want I just move it to my computer. That way all our accounts are separate, but if there is something I want I can get it. Also, since the music no longer has DRM, it won't matter. It will play on any computer. What you should see is if you can just do the shared library with multiple accounts. Then if you don't have videos or such, you can get apps or music. Hope this helps!

  • How can multiple users use the same Creative Cloud Individual on one single-machine?

    We have one shared graphics workstation, which is infrequently in use by different people - therefore we bought a single-workstation license (which we were referred to "Creative Cloud Individual"). In the FAQs it says it installs locally, but whenever a user different from the installing adminstrator logs in, he is forced to use the trial.
    Is there a way to make the local installation usable on that single machine for multiple users?
    Thanks in advance for your reply

    Serenatasystems do the other users not have administrator access?  What happens if they sign in using the Adobe ID tied to your Creative Cloud subscription?  Do your Adobe Creative applications then exit trial mode?

  • How can I use multiple ipad's on one account without sharing individuals personal email accounts?

    Is it possible to have multiple ipads on one account and share info, but also allow the individual users to have personal email that is not seen on the other ipad's? We have all ipads on same icloud account because we all need to see the same ical. It seems like that's the problem. If it IS related to icloud then if we have separate icloud accounts, how would we share the main ical otherwise? Sharing the ical is very important for this business so everyone can access the daily schedule. Of course each user still wants to have private email.
    Hope this wasn't too confusing!
    Thanks!
    Doreen

    you could set up the main icloud itunes acount for ical and not have in setup on the devices
    and share the calandar with the other itunes accounts on the devices
    or only have it on one device
    devices have the users indervidual itunes icloud setup
    they should be able to access the shared "main" itunes icloud ical account once it's shared
    http://howto.cnet.com/8301-11310_39-57542557-285/three-methods-for-sharing-an-ic loud-calendar/
    if the devices are company owned you could go futher and setup find my iphone on the main itunes account
    and not on the user icloud accounts

Maybe you are looking for

  • Reverse a reset clear document

    Hello , When I am trying to reverse a reset-cleared document, it is throwing the following error :- "Document xxxxxx cannot be reversed due to clearing resets". I followed the foll steps. 1.There was an invoice of 100$. 2.Incoming payment of 100$-. 3

  • [SOLVED] netconsole working great - local journal's now almost empty

    the kernel command line never worked for me. I realized I had network init disabled in the bios.  Enabling bios init did not let netconsole start either at the boot parameters, or  the entry in   /etc/modules-load.d/ The service that loads the module

  • Adding custom fields in Delivery transaction

    Hi, I need to add custom fields in the delivery transaction(VL01N/VL02N) at Item level in Material tab screen. Are there any screen exits available for delivery order in any other tabs or Do I have to modify the standard program. Regards, Sudheer

  • Why there is a music app

    Guys I tought that if you put a dedicated music app on your FLAGSHIPS it will be actually possible to listen to the music. This hilarious phone (z3) can't even properly drive my EXTREMELY LOW impedance headphones - Grado SR60i, these are only 30 ohms

  • Why i have been charge 1 USD for confirm information for credit card on apple store?

    i have iphone 4.I have download free application from apple store.before download they confirm my credit card details.why I have been charge 1 USD for free application or for confirm my credit card details.?