Home Segments Top Top Previous Next

895: Mainline

You can test the MarqueThread class with the following program:

import javax.swing.*;                            
public class ThreadTestor { 
 public static void main (String argv []) { 
  JFrame frame = new JFrame("Thread Test"); 
  Marquee marquee = new Marquee("Buy On To Java Today!"); 
  MarqueeThread thread = new MarqueeThread(marquee); 
  thread.start(); 
  frame.getContentPane().add("Center", marquee); 
  frame.setSize(550, 200); 
  frame.addWindowListener(new ApplicationClosingWindowListener()); 
  frame.show(); 
 } 
}