jlist Questions
3
Solved
3
Solved
class MyListListener implements ListSelectionListener {
public void valueChanged (ListSelectionEvent e) {
JList source = (JList) e.getSource();
// do something
}
}
JList myList = new JList (m...
Fujio asked 19/10, 2012 at 13:37
4
I encountered a problem regarding reordering elements in a JList using Drag and Drop. This following code is a modification of a code where you could drag elements from one JList to another (worked...
Selfinduction asked 16/5, 2013 at 11:46
4
Solved
i have a jList in gui where i can add some data with Add button.
what i want to add another button called Clear which will clear all elements.
i tried this:
private void jButtonClearActionPerfomed...
Faviolafavonian asked 28/11, 2012 at 4:35
3
In my current swing project I have a JList displaying all active sockets, and each cell has a JButton to close that socket. But the JButton in the cell is not clickable: listener does not get fired...
6
I've got a simple Jlist with data from List<String>, Now I want to remove selected item from Jlist.
Here is the code:
final DefaultListModel<String> model = new DefaultListModel();
fin...
Giraldo asked 8/11, 2012 at 22:10
5
Solved
I was wondering if there is a way to retrieve a list of all the elements that have been added to a JList. For example I would like JList to return an array or list of Strings or JLabels from a cust...
7
Solved
Part of my code
ArrayList<Item> i = g.getItems();
Vector itemsVector = new Vector(i);
JList items = new JList(iemsVector);
Later in the code I create new object which I want to add t...
9
Solved
OK so I'm doing a small part of my inventory. I got MOST of it down. I'm trying to add string items to an ArrayList then add that to a JList. However, I'm getting this error when I compile:
C:\Use...
3
Solved
Can anyone tell me a short way to delete the selected items from my JList?
I searched on google and here, but I found very many ways. Which way should I use?
7
Solved
I've got the next code:
listModel = new DefaultListModel();
listModel.addElement(dateFormat.format(new Date()) + ": Msg1");
messageList = new JList(listModel);
messageList.setLayoutOrientation...
Fidel asked 25/1, 2010 at 13:11
3
Solved
I've got a JList which displays information from a vector. The user can then add and remove information from this vector. Is it possible to refresh the JList inside my JFrame when items are added /...
3
I have a JList with very long item names that cause the horizontal scroll-bar to appear in scroll-pane.
Is there anyway that I can word wrap so that the whole whole item name appears in 2 rows yet...
Californium asked 19/11, 2011 at 20:43
4
I have a JList with an array of strings. Basically it displays a restaurant menu.
right next to the JList i have another JList which is empty. Whenever a user double clicks on a string in the first...
5
Solved
i have a JList and an ArrayList.How to bind the datas in arraylist to the jlist.Are the any alternative methods?
ArrayList arl = new ArrayList();
arl.add("1asdsd");
arl.add("2asdsd");
arl.add...
1
Solved
I have multiple Jlist components. When an item in the first list is selected, the next list should dynamically display a new set of possible selections.
For example, the first list might have thre...
Sheeran asked 6/1, 2017 at 21:20
3
I've been scouring the internet for this answer. I have a simple JList with items inside it. When I right-click, I want a menu to pop-up that says "Use, drop, cancel" or something of that nature. H...
5
Solved
It's funny, I can't find out how to delete multiple selected items in a JList
Help please
UPD:
OK, the problem was in NetBeans, because it creates JList and sets model AbstractListModel which s...
2
Solved
could you please help me, how to change color of items showed in JList?
I'm making an user JList where I can see online and offline users, and I need the offline users to have different colors tha...
Keilakeily asked 20/4, 2012 at 17:56
2
I have an object - ArrayList<User> users that contains a few user objects.
public class User
{
int id;
String name;
String location;
}
I want to put this ArrayList in a JList so it will...
6
If a selected index on a JList is clicked, I want it to de-select. In other words, clicking on the indices actually toggles their selection. Didn't look like this was supported, so I tried
list.ad...
3
Solved
I have a JTextField and a JList in my program. The JList contains the user's contacts. I'd like to filter the JList based on the text on the JTextField. For example, if I type in "Mike" it will onl...
Weimaraner asked 7/2, 2013 at 18:26
3
Solved
Despite a lot of research I can't find an answer or solve how to get the selected text element inside a JList to a variable. Therefore I would preciate some help. I have tried to select the index o...
7
Solved
I'm making a custom ListCellRenderer. I know that you can have different dimensions for each individual cell. But now I want to have a different dimension for the selected cell. Somehow, the JList ...
4
Solved
How can I change the background color of the item which is selected in JList dynamically?
1 Next >
© 2022 - 2024 — McMap. All rights reserved.