/**
* The driver for JMUlti -- a multiple window text editor
*
* @author Nancy Harris
* @version 1.0
*/
public class JMUlti7
{
   /** 
    * The entry point for JMUview
    *     
    * @param args The command-line arguments, provides the number of windows    
    */   
   public static void main(String[] args)
   {
		TextEditor editor;
		TextWindow [] window;
		int windowNumber;
		String text;
		
		// read in the command line arguments
		if (args.length == 0)
			windowNumber = 1;
		else
			windowNumber = Integer.parseInt(args[0]);
		
		window = new TextWindow[windowNumber];
		
		for (int ii = 0; ii < window.length; ii++)
		{
			text = "JMUlti -- Window " + (ii + 1);	
			// create a new TextEditor object	
			editor = new TextEditor();
			editor.setShouldHaveScrollBar(true);
			editor.setEditable(true);
			editor.setText(text);
			editor.selectAll();
		
			// instantiate one window
			window[ii] = new TextWindow(text);
			
			window[ii].setTextEditor(editor);
			window[ii].setShouldConfirmExit(true);
			window[ii].addFileMenu();
			window[ii].open();
			window[ii].setVisible(true);
		}
	}
}