Item « JList « Java Swing Q&A





1. large virtual lists in Swing using AbstractListModel -- limit at 119,000,000 items?    stackoverflow.com

I've got my "virtual list" in swing working well, but it seems to fail when I exceed some particular number of items. By "fail" I mean that the scroll bar magically ...

2. How to de-select a JList item from my program    stackoverflow.com

I have a JList, and a JButton, user can click an item in the JList or they can click the button, when the button is clicked how do I de-select (change ...

3. How to show items on a jList in java?    stackoverflow.com

I have made a java GUI program and have added a jList on that GUI so as to print output of the program on that jList by adding an item by ...

4. Find out if JList has an item currently selected    stackoverflow.com

I have a JList which is populated after importing a file. Is it possible to have the first item/element of the JList highlighted/selected. I have browsed many places hoping to find a line ...

5. How would I code when a item has been selected in a JList?    stackoverflow.com

I have a JList with 5 options in it and when one of the items becomes selected or clicked i want the text area next to it to show a paragraph ...

6. Need to set a double value depending on which item(s) are selected from a JList    stackoverflow.com

My code so far:

import java.awt.BorderLayout;
import java.awt.Container;
import javax.swing.Box;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JList;
import javax.swing.JScrollPane;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;

public class TestFile2 {

    public static void main(String args[]) {
       ...

7. JList not showing items or showing selectively    stackoverflow.com

I have a Java Swing application using a JList to show some data from a DB. I am using DefaulListModel as the data model for the list in this way:

void PopulateSoldiersList() 
{
 ...

8. Show box on hover of item in jlist    stackoverflow.com

I want to show box that contains information when user hovers on an item in list. Something like follows: enter image description here How can I do this? This can be ...

9. How to make one item in a JList bold?    stackoverflow.com

I'm making enhancements to a Swing app (never done Swing programming before), and need to be able to make a single text item in a JList bold. I've seen a ...





10. Jlist select mulitple items    stackoverflow.com

I faced a problem with this setSelectedValue() method in JList when I wanted to select multiple values in a JList automatically, it still selected only one. Is there a way?

 ...

11. jList Selected Item to String? (Java)    stackoverflow.com

could someone tell me how to get the selected item of jList1 to a string? It is a single selection jList.

12. removing items from the JLIST    stackoverflow.com

When the delete button is pressed a runtime error occurs, and the item doesn't delete until the the channelTitleJList (left side of the JScrollPane is pressed again). Why doesn't the ...

13. How to remove multiple items in JList    stackoverflow.com

It's funny, I can't find out how to delete multiple selected items in a JList Help please enter image description here UPD: OK, the problem was in NetBeans, because it creates JList and ...

14. Remove Item from JList throws NullPointerException    stackoverflow.com

NetBeans. UI created using IDE. My implementation In order of appearance: 1 global form variable:

private DefaultListModel model;
2 constructor:
ArrayList<String> cameras = repository.getCameraNames();

model= new DefaultListModel();
for (int i = 0; i < cameras.size(); i++) {
  ...

15. JList highlighed stay on previously selected item    bytes.com

Hi, I am wondering if there is way to twist JList such that the highlight still remains on previously selected item after other item is selected. For example, this list has ...

16. Using a keystroke to delete an item from JList    forums.netbeans.org

Untested Example, a more sophisticated approach would be to bind selected list items via Beans Binding to the action; You can't be sure to get the list through the source of the action event, e.g. if the action was called through a popup menu, so the JList is a field in the action: 1. Action Code: public final class RemoveSelectedListItemsAction extends ...





17. How do I get a string from an item in a dynamic jlist?    coderanch.com

I am using Forte for Java Internet Edition to write an application that uses an nbCacedRowset from a database query at runtime to dynamically populate a jlist. Next to the jlist is a panel of text fields that needs to be dynamically populated with information from the same database depending on what item in the jlist is focused on. More specifically, ...

18. HighLighting JList items    coderanch.com

hi i have a frame.from this by clicking one menuoption i just popsup a JDialog.on JDialog i have a JList.i am selecting items from this and storing in a vector.i am passing this vector to that frame.when i am clicking menu option second time again i am passing to the dialog class and JDialog should be shown with highlighting the previously ...

19. Deselection of Items in a JList    coderanch.com

Cool, I think it works., But let me ask you this. How do you get the selection to go away. Say I select the 1st name, then I click a refresh button, the item in the list still appears to be selected. I want it to become unselected. Thanks ------------------ Happy Coding, Gregg Bolinger

20. JList deleting multiple items    coderanch.com

Maybe I didn't explain the situation good enough. Here goes round two. I have a vector which feeds a JList. Each item is a String and I allow the JList to have multiple selections. I have a delete button which gets the selection indices and then attempts to delete the selected items from the vector. Problem is that it will always ...

21. problem selecting JList item    coderanch.com

22. JList - get next item?    coderanch.com

hi yes I don't want a given answer it's jsut I may be missin a simple option her and getting a bit confised with types. I have tried to navigate about my JList using SelectedIndex / SelectedValue (get & set) but run into a few problems with the types clashing (index needing int and value being the file path & name ...

23. How to make items of JList editable?    coderanch.com

24. Ordering Items in JList    coderanch.com

hello all, I am not really a GUI designer, but these days I got to design some GUIs with JLists. Well, My first question is what is the way used to set a JList header. for example we have 3 columns in jList, the first one is "Name", the second "Age" .... My second question : is it possible to sort ...

25. not able to get the items from JList    coderanch.com

The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - ...

27. Count items in JList    coderanch.com

29. Inserting items into a jlist    coderanch.com

Hello, I am having a weird problem with my jlist. I am declaring an array of strings, and then I am using List.setListData(array) to display the items. It worked fine in one place, then in another place it just wouldn't work! I am using System.out.println to print the contents of the array, and everything is in order there, but it just ...

30. JList Showing null items    coderanch.com

31. how to grey out jlist items    coderanch.com

32. Unable to select/deselect items in a JList while it is performing some task    java-forums.org

Hi, I am using JList to show some data in JScrollPane.If I am selecting some items from the JList to perform some task I am unable to deselect them or select any other items from the JList until the completion of the task . I want to deselect selected items or select the other items to perform some other task before ...

33. How can I save items in my JList?    java-forums.org

I recently started programming classes, and I believe i've grasped the basics of JAVA. However, i haven't learned anything about saving data yet and I'd appreciate if someone could help me out with this. I'm currently working on an application I'm making for practice that keeps track of shows that i watch. It has a JList that stores custom objects i ...

34. JList question, at an item at selected index    forums.oracle.com

35. Accessing item selected in JList in superclass from subclass    forums.oracle.com

I cannot do this in the superclass as subclass 1 is not the only subclass. This makes no sense since your subclass has only one super object and this super is not used by anything else. I suspect that your design is borked that you're using inheritance wrong, but without more information on what you're trying to achieve, it's hard to ...

36. JList deselect all List items    forums.oracle.com

Hi I have a List of JList items. These Items are drawn whenever a shape is drawn. I am creating a program that draws shapes. I divided the ContenttPane of my JFrame into 2 JPanels: the right panel is where I draw the shapesand the left panel is for list items of a JLIst. So whenever I draw a shape on ...

37. selecting item from jlist    forums.oracle.com

38. easiest way to put xml items in to a jlist?    forums.oracle.com

i have to load some food in to 3 jlists for a project at uni some examples of starters main courses and deserts i was wondering if it was easy to to get information from a xml like the name of the food to then display in the jlist then when the item is clicked it gets some more values from ...

39. How to underline the item in a Jlist?    forums.oracle.com

40. Moving items up and down in a JList    forums.oracle.com

The code I posted doesn't compile because I abridged it in order to show the pertinent code. It probably misses curley brackets and many other classes. But I would like to know if the concept is sound. And as I said the item does move and does so repeatedly. Only the highlight lags behind or precedes the selected item. -Reg

41. Autoselect an item from a JList    forums.oracle.com

You will have a much better chance of getting help if you show the work that you've already done and asking specific questions from your own code rather than simply posting a homework assignment verbatim as you've done. By doing the former, the forum volunteers see you as a hard-working motivated individual in need of help, help that they will gladly ...

42. Disable item from JList    forums.oracle.com

43. Problem with matching JList items    forums.oracle.com

Hello, I have strange problem. I've written an applet with simple interface. It has two JList objects. I read data from file and insert it to my two lists. But when I start browser with applet it reads this data but problem is when I try to match one of items from lists. It matches it only for couple miliseconds and ...

44. Programatically Select an Item in a JList    forums.oracle.com

JList.selectItem(0) will select the item 0 in the model but it will NOT visually highlight the selected item in the list. Neither will ensureIndexIsVisible(0), I need to automatically select and item in a list (highlight that item as well) As if someone has clicked on that item with the mouse.. however they haven't you see, my program has done it, programatically. ...

45. Unable to select/deselect items in a JList while it is performing some task    forums.oracle.com

Hi, I am using JList to show some data in JScrollPane.If I am selecting some items from the JList to perform some task I am unable to deselect them or select any other items from the JList until the completion of the task . I want to deselect selected items or select the other items to perform some other task before ...