Speak the contents of the selected JList item(s)

D

danielliuhh

Hello,

I have put a JList and a speaking button on the interface.

I need choose an item (or more than one item) from the JList, and then
click the speaking button to make the selected contents spoken. Is it
possible to do it?

If so, how can I make it work?

Thank you in advance,

Daniel
 
A

Andrew Thompson

....
| I have put a JList and a speaking button on the interface.
|
| I need choose an item (or more than one item) from the JList,
and then
| click the speaking button to make the selected contents spoken.
Is it
| possible to do it?

There are various ways you might do it.

| If so, how can I make it work?

One way is to record a .au sound
and play it when the appropriate
item is selected.

HTH
 
A

ak

I need choose an item (or more than one item) from the JList, and then
click the speaking button to make the selected contents spoken. Is it
possible to do it?

the proper way is to use auxiliary LookAndFeel.

you can install it with: (assume name of your LnF is SpeechLookAndFeel)

UIManager.addAuxiliaryLookAndFeel(new SpeechLookAndFeel());

or add following to swing.properties file:
swing.auxiliarylaf=SpeechLookAndFeel

or start your java programm with
java -Dswing.auxiliarylaf=SpeechLookAndFeel <yourProgrammName>

see also
http://java.sun.com/j2se/1.4/ja/docs/ja/api/javax/swing/plaf/multi/doc-files
/multi_tsc.html

____________

http://reader.imagero.com the best java image reader.
 
V

VD

I am not sure what is your problem is. Not because your question,
because it's very broad. What's your background? "Is it possible to
do it?" yes, to all of the thing. I am not sure which part your
question is. Yes, you can make a JList, yes, you can sure click on
it. Yes, you can capture the event and find out which one was
selected, and yes, you can use Java software to speak the item stuff
up using a third party library. If your question is about java, learn
it a bit (java.sun.com), because no one here can teach you the whole
thing. I am not sure if someone would write you the code. Question
about speaking, you can search for +java +speech, or better, try
freetts.org (support English) , it doesn't sound that good, but it's
easy, and free with source code. Commercial library could give you
better sound. Good luck.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top