FileDocCategorySizeDatePackage
TalkingJDialog.javaAPI DocExample2253Wed Jul 17 00:42:38 BST 2002com.wiverson.macosbook.speech

TalkingJDialog

public class TalkingJDialog extends JDialog implements MouseListener

Fields Summary
private com.apple.speech.synthesis.Synthesizer
mySynthesizer
private String
spokenText
Constructors Summary
public TalkingJDialog()

        this.setResizable(false);
        this.addMouseListener(this);
    
Methods Summary
public voiddispose()

        super.dispose();
    
public java.lang.StringgetNotificationText()

        return spokenText;
    
public voidhide()

        super.hide();
        // If the dialog goes away, be sure to stop talking.
        mySynthesizer.stopSpeech();
    
public voidmouseClicked(java.awt.event.MouseEvent mouseEvent)

public voidmouseEntered(java.awt.event.MouseEvent mouseEvent)

 
public voidmouseExited(java.awt.event.MouseEvent mouseEvent)

public voidmousePressed(java.awt.event.MouseEvent mouseEvent)

        if(mySynthesizer != null)
            mySynthesizer.stopSpeech();
    
public voidmouseReleased(java.awt.event.MouseEvent mouseEvent)

public voidsetNotificationText(java.lang.String inString)

        spokenText = inString;
    
public voidshow()

    
      
    
        super.show();
        // Get a synthesizer for this dialog
        // if one isn't already available
        if(mySynthesizer == null)
            mySynthesizer = new Synthesizer();
        // Start talking!
        mySynthesizer.speakText(getNotificationText());