> Hi,
> In Windows environment, to rename a file, the user can just select the
[quoted text clipped - 6 lines]
> explorer?
> Thanks a lot
Unfortunately there is no such thing as a list editor. Still, you have
several options here:
- rethink your GUI and use a JTable (eg with one column) or a JTree to
allow users to edit the nodes
- subclass JList to create your own editable list (you can use the JTable
or JTree source for ideas)
- add a popup menu to the JList, which allows you to edit the currently
selected item
- ...
An example using a one-column JTable:
http://www.esus.com/javaindex/j2se/jdk1.2/javaxswing/atomiccontrols/jlist
/jlisteditable.html
An example subclassing JList:
http://www.jroller.com/page/santhosh/20050607
The second example looks very good indeed. I haven't tested or examined
it thoroughly, but it looks very promising. And since Santhosh Kumar did
all the hard work for you, it should be easy to implement.

Signature
Beware the False Authority Syndrome
a - 27 Nov 2005 19:40 GMT
I have subclass JList and I have a popup menu for my JList, how this allows
me to edit the selected item?
Thanks
"zero" <zero@this.hi> ¼¶¼g©ó¶l¥ó·s»D
:Xns971B8CD8724CBzerothishi@195.130.132.70...
>
[quoted text clipped - 30 lines]
> it thoroughly, but it looks very promising. And since Santhosh Kumar did
> all the hard work for you, it should be easy to implement.
zero - 27 Nov 2005 22:21 GMT
> "zero" <zero@this.hi> ¼¶¼g©ó¶l¥ó·s»D
>:Xns971B8CD8724CBzerothishi@195.130.132.70...
[quoted text clipped - 25 lines]
> allows me to edit the selected item?
> Thanks
Did you look at the examples? The second example clearly shows how to
create an editable list. You can even run it using webstart:
http://www.jroller.com/resources/s/santhosh/EditableJList.jnlp
If you want to use a popup menu, just make it create a separate JFrame
that will let you enter new info, and then substitute that in the list.
But the easiest is just to take Santhosh Kumar's code. You can copy this
into a file, create a GUI that shows a JListMutable, compile, and you're
done.

Signature
Beware the False Authority Syndrome