Drop « JList « Java Swing Q&A





1. How to enable drag-and-drop inside JList    stackoverflow.com

I have a JList and want the user to be able to reorder the elements in the list using drag-n-drop (using my own ListModel and ListCellRenderer, if that makes any difference). ...

2. Drag & Drop from JList to JPanel in Java Swing    stackoverflow.com

In my little project I have JList and JPanel (Jlist has custom list cell renderer which extends JLabel - so I have JLabels in JList). I want to transfer JLabels from ...

3. ListTransferHandler in DropDemo has a bug    stackoverflow.com

this is a repost from the OTN Discussions Forum because I did not get an answer there. In Java, I would like to enable Drag and Drop in a JList ...

4. JList drag CustomObject but drop String    stackoverflow.com

private JList attributesList;

public AttributeGroupComponent(ArrayList<?> items) {
    attributesList = new JList(items.toArray());
    initGui();
}

private void initGui(){         
    ...

5. Drag 'n' Drop in JList    coderanch.com

7. Using Drag and drop with JLists to fire an event    coderanch.com

I am not very good with GUI programming yet, but what I would like to do is create an object that has a JList and be able to drag and drop from on instance of this list to another. In 1.4.1 this is really easy, just enable dnd in the JList. However, the default copy, link, move is not what I ...

8. Drag and drop between a JList and a header table    coderanch.com

Hi, I am doing a Swing application now. I need to drag and drop between a JList and the column header of a table. The header is a table too. I set everything and can drag and drop from the list to the header. However, there is no response such as mouse icon change when doing DnD from the header to ...

9. drag and drop with Jlist (weird)    coderanch.com

hi guys, I have 2 lists (A & B) where you can drag items from one another. The problem is (and this is wierd) that if there is no item on B, you cannot drag anything from A to B. If there's somthing on B, and you want to move an item from A to B, you first have to drag ...





11. How to display contents of JList or drop down list?    coderanch.com

sendInterface mySend = new sendInterface(getUser()); mySend.setUserName(getUser()); mySend.setListName(); mySend.myInterface(); import java.awt.BorderLayout; import java.awt.Image; import java.awt.GridLayout; import java.awt.Panel; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.DefaultListModel; import javax.swing.Icon; import javax.swing.ImageIcon; import javax.swing.JFrame; import javax.swing.JButton; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JRadioButton; import javax.swing.JScrollPane; import javax.swing.ListModel; import javax.swing.UIManager; import javax.swing.SwingConstants; import java.io.*; import java.sql.*; import java.net.*; import java.util.ArrayList; public class sendInterface /*implements ActionListener*/{ JFrame frame = new ...

12. Drag and Drop between 2 JLists - ReportingListTransferHandler    coderanch.com

Rob Camick wrote:Try the ListTransferHandler from the Drop Demo example found in the Swing tutorial. Thanks for your help! I've taken a look at the ListTransferHandler and decided to try my luck with ReportingListTransferHandler again. I've read the Swing tutorial until "Export Methods" and supposed the error is in the exportDone method. I can reproduce the error with this little modification: ...

13. help with drag and drop on JList    java-forums.org

I bulid two JLists(list1, list2) in a JPanel, I want to drag a element A from list1 and drop it on a element B of list2, then a event will occur (like a dialog, rather than just add A into list2). Can anyone tell me how to implement this. I kown how to just drop element into list2 but I don't ...

14. Cant display value of JList or drop down list    forums.oracle.com

I'm not expert in this especially database stuff, but I see that you have a DefaultListModel that you fill but never use. I also see that your JList uses arrayObject to fill its data, and yet you never add data to the arrayObject array. Maybe I'm missing something here, but why not use the model as your list's model?