// Register Face object as // AnimationListener with (Web hosting ratings)
// Register Face object as // AnimationListener with Animator object a.addAnimationListener(face); // Load the voice (mainly the lexicon) voice.allocate(); // Create a PlayerModel instance with the new voice PlayerModelImpl impl = new PlayerModelImpl(voice); // Create a PlayerPanel instance and pass the PlayerModel object // and the Face-Objekt to it. playerPanel = new PlayerPanel(impl,face); // Use the size of the PlayerPanel for the whole Player setSize(playerPanel.getContentPane().getSize()); // Insert the PlayerPanel into the Player getContentPane().add(playerPanel.getContentPane(), BorderLayout.CENTER); } main() The main() method simply creates a new Player instance and makes it visible. Before doing so it sets Swing s Look and Feel to Metal. /** * Method main. * The main() method of the Player. * * @param args (not used) * @throws Exception */ public static void main(String[] args) throws Exception { // Set Metal Look&Feel for Swing try { UIManager.setLookAndFeel( “javax.swing.plaf.metal.MetalLookAndFeel”); } catch(Exception e) { System.err.println(”Error setting look&feel: ” + e); } // Create new Player instance Player player = new Player(”Animated FreeTTS Player”); // and display it player.setVisible(true); } } You have now completed your application. In the Package Explorer you should now select the Player class in the DukeSpeaks project and then call the Run > Run As > Java Application function. If everything was done correctly, you will now see the window shown in Figure 5.3. 108 Chapter 5
MySQL web hosting will be off your worry about list if you sign up with us,just trust us and go check MySQL Web Hosting services.