jlist Questions

2

Solved

How do I disable multiselect in listbox (Jlist) of java? Code: configId.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); defaultModel = new FTCSDefaultListModel(); defaultModel.addElement(c...
Eyelid asked 9/5, 2014 at 5:7

4

Solved

I'm using a JList as part of a wizard to display all the steps to be performed (it also allows clicking on a step to go to it). Some steps will not always be needed, based on what's done in previou...
Thielen asked 1/12, 2011 at 16:4

3

Solved

I have a JList with a DefaultListModel. How I can make an item in a JList react to double-click event?
Adalbertoadalheid asked 3/12, 2010 at 10:36

4

Solved

When I call JList<String>.getModel() and cast it to DefaultListModel<String> it gives me this exception. Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: javax.swin...
Staphylorrhaphy asked 29/4, 2012 at 19:12

1

Solved

I have created a JList using GrazedLists, specifically an EventList which I then pass into a SeparatorList with a custom Comparator that sorts my EventList elements. I am using a DefaultEventListM...
Demosthenes asked 21/2, 2015 at 22:46

4

Solved

I want to JList a lot of results in a JOptionPane, however, I'm not sure how to add in a scroll function should there be too many results. How would I add a scroll bar to a JOptionPane? Any help wo...
Blamed asked 4/12, 2011 at 11:39

2

Solved

I'm beginner in Java. I really need to return DefaultTableModel (javax.swing) from array or ArrayList. It is possible? I can't insert array into DefaultTableModel (constructor). Code is below: p...
Physiology asked 2/10, 2013 at 19:6

0

I write client-server chat using sockets. Help me please understand how send the list of current registered users from server to clients and update it when list changed. I read this similar post bu...
Deimos asked 6/9, 2014 at 10:17

2

Solved

I recently encountered a bug in java where JList will fire the valueChanged() method twice when changing a value with the mouse, and only once when changing a value with the keyboard. I just found ...
Brachy asked 17/9, 2012 at 14:38

2

Solved

How can I fetch a component from a JList, with the click location? I have my own list cell renderer where I insert some panels and labels. Now i want to get e.g. the label where the user clicked a...
Acquah asked 17/2, 2013 at 23:18

3

Solved

I have this class: @SuppressWarnings("serial") private class DataCellRenderer extends JLabel implements ListCellRenderer { public DataCellRenderer() { setHorizontalAlignment(SwingConstants...
Conjunctive asked 24/10, 2011 at 20:58

3

I'm using a JList to hold chat data for my chat program. It uses a custom list renderer to render a custom JPanel object as the element type. This JPanel contains two JLabels (anchored to the top, ...
Deandeana asked 23/2, 2012 at 6:50

3

Solved

I have a JList which uses a DefaultListModel. I then add values to the model which then appear in the JList. I have created a MouseListener which (when double clicked) allows the user to edit the ...
Gate asked 25/3, 2012 at 23:53

1

Solved

I can't believe this does not work. I have a JList. I have set its renderer as follows. Basically RankingPanel is a JPanel with two labels and a button. topAchieverList = new JList(); topAchiever...
Possing asked 21/3, 2014 at 20:25

1

Solved

Hi i have created a j list and there i want to add an image before any text in that text how can i do this i tried but i am not able to achieve my goal i want to add an image before list element"Ba...
Horsewoman asked 8/3, 2014 at 7:33

2

Solved

here is my problem: I have a jList and a popup menu. When I right click the jList, the popup menu shows. The problem is that the jList item which the mouse is pointing at won't select. And I want i...
Hermaherman asked 15/5, 2011 at 10:44

4

Solved

I have a function that executes when a button is clicked. Suppose there is a loop to add 1 to 10 to a JList. I add that data to DefaultListModel. It works perfectly and the numbers get added. Then ...
Oxus asked 16/9, 2011 at 8:56

2

Solved

I was wondering how to modify a JList so that clicking any values would not do anything. I have looked at other questions but none have helped.
Adversative asked 25/7, 2013 at 16:33

1

I have an array of objects that contain the name of customers, like this: Customers[] How I can add those elements to an existing JList automatically after I press a button? I have tried something...
Cone asked 25/4, 2013 at 12:15

3

Solved

I was googling for a solution to retrieve data back from a JList component, but didn't find any.So, is there a method of Jlist that return its items? I don't want just a selected one. I want the wh...
Clementclementas asked 22/3, 2013 at 10:59

1

Solved

I have a JList containing an ArrayList of custom objects and I'm trying to create a drag and drop into fields. I'm having trouble understanding how to package and receive the object in Transferable...
Mythos asked 13/12, 2012 at 7:40

3

Solved

I have a JList, where i am displaying some ID's. I want to capture the ID the user clicked and dis play it on a JLabel. String selected = jlist.getSelectedItem().toString(); The above code gives...
Alanalana asked 10/12, 2012 at 12:16

3

Solved

I'm trying to place a JList inside of a JScrollPane and have it alphabetically list the entries in vertical columns like this: A D G B E H C F However when the JList runs out of space to displa...
Berceuse asked 2/2, 2012 at 19:33

1

Solved

I have a JList inside a JScrollPane that's placed in a JPanel (BorderLayout.CENTER) and putting that inside another JPanel's BorderLayout.EAST (this JPanel's CENTER contains another JPanel) and thi...
Leviticus asked 28/11, 2012 at 8:45

2

Solved

Hi I have to pick an element from a JList to another, removing it from the first The method I've created inserts only one element, overwriting the last one and doesn't remove the selected item from...
Modie asked 6/3, 2011 at 19:57

© 2022 - 2024 — McMap. All rights reserved.