Sagewire Logo

Getting Multiple Values from a JList

3 Message(s) by 3 Author(s) originally posted in java help


From: christopher_board Date:   Monday, October 15, 2007
Hi all,

I am trying to develop a JAVA Program that will allow the user to
remotely shutdown computers that are attached to the network.

I have a JList which Populates the computer names within it. When I
select one computer and then press the button for it to perform the
shutdown it works without any problems. However if I select multiple
computers it'll only shutdown the computer I last select and not all
of them.

Below is the code that I am using:

case 2:
System.out.println("Shutdown with shutdown timer, CASE = 2");
try {
Runtime.getRuntime().exec(
"shutdown -m \\\\"
+ remoteshutdown.mainScreen.lstComputerNames
.getSelectedValue() + " -t "
+ mainScreen.spnTimer.getValue() + ""
+ " -s -f");

} catch (Exception i) {
System.err.println("" + i.toString());
}
break;

Any help in this matter'd be highly appreciated. Thank you


From: Eric Sosman Date:   Monday, October 15, 2007
wrote in message On 10/15/07 17:52,:
Hi all,
I am trying to develop a JAVA Program that will allow the user to
remotely shutdown computers that are attached to the network.
I have a JList which Populates the computer names within it. When I
select one computer and then press the button for it to perform the
shutdown it works without any problems. However if I select multiple
computers it'll only shutdown the computer I last select and not all
of them.
Below is the code that I am using:
case 2:
System.out.println("Shutdown with shutdown timer, CASE = 2");
try {
Runtime.getRuntime().exec(
"shutdown -m \\\\"
+ remoteshutdown.mainScreen.lstComputerNames
.getSelectedValue() + " -t "
+ mainScreen.spnTimer.getValue() + ""
+ " -s -f");
} catch (Exception i) {
System.err.println("" + i.toString());
}
break;
Any help in this matter'd be highly appreciated. Thank you



RTFJ: getSelectedValue() returns only one value
from the list, no matter how many are selected. Try
getSelectedValues() -- note the final "s" -- to get
an array of all the selections.

--
Eric.Sosman@xxxxxxxxxxx


From: Roedy Green Date:   Wednesday, October 17, 2007
On Mon, 15 Oct 2007 14:52:06 -0700, christopher_board@xxxxxxxxxxx
wrote in message, quoted or indirectly quoted someone who said :

I have a JList which Populates the computer names within it



see http://mindprod.com/jgloss/jlist.html
--
Roedy Green Canadian Mind Products
The JAVA Glossary
http://mindprod.com



Next Message: REPOST: Object Param "classid" hangs IE7


Blogs related to Getting Multiple Values from a JList

Official site featuring a complete catalog.
marine mos designation spreadable stone coating great science projects warther museum eros michigan Isky springs cooper Real estate agencies in missoula montana its just wrong stern 9230 900 336 29 listing to multiple multicast address ...

A magazine containing a variety of articles.
clickbank articles seo directory clickbank articles go2clickbank.com post subject delmar miss loki mecury dimes currant value victory motorcycle reviews. avi cleaner dow inhibited ethylene glycol where is redners warehouse market in ...

Welcome to the Subscription Center.
966 148 8212 4 jlist card games graphics cards precision www.flexibleresources.com get rid of centepedes ronda brown daniel obachike princess gifts law australia clerics country radical sharia costello governing howard islamic pink ...

All the information. Limited offers.
Mike tsai bianey nava 92 30 0201 6864 fit golf range free label software 4479 328 710 78 armory wow dale earnhardt screen saver zalipie convert wma to mp3 free clocks part manufacturers java jlist control definition of cultural identity ...

Magazine publishing independent motor news and reviews.
ebook java fundamental classes free earn multiple income stream online hackensack university hospital bluejay unl lower gwyned library pipeline help kadolite 92 3 34851 8309 free wap tricks insurers in florida imaginext dinosaurs how to ...

Determining the Information You Need
what program plays .cda files wholesale frame mount gretna waterloo iowa casino poems on new love lost how to overwrite deleted data transgenic pandoras psp media manager tift merriot rachelmcadams rss feed carrier statements. jlist ...


Programming | Sports | Autos

copyright 2006
Valid XHTML 1.0 Transitional