Hi,
I need to come up with a java program (JList) to monitor products/goods for my operation.
The program should let me enter products (items) or delete them, one at a time.
Once entered, a product (item) should be highlighted or painted in “Red” or default color, indicating it needs attention.
Once I finish considering a product in the list, I would like to toggle that product (item) to change the...
User Profile
Collapse
-
Jlist paint individual item with a click
-
Can you be more specific, JosAH?
I tried the below code borrowed from Hans Muller, Sun java website, and it makes item being toggle only but does not keep 2 items highlighted.
JList list = new JList(MyArray);
list.setSelecti onModel(new ToggleSelection Model());
class ToggleSelection Model extends DefaultListSele ctionModel
{
public void setSelectionInt erval(int index0, int index1)... -
JList highlighed stay on previously selected item
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 4 items: A, B, C, D
If I select A, A will be highlighted.
I then select C, C will be highlighted and A still remains highlighted as well.
I then re-select A again, A now becomes "de-highlighted".
Thanks in advance,...
No activity results to display
Show More
Leave a comment: