public InteractionTab(DialogueSystem system){
  this.system=system;
  setLayout(new BorderLayout());
  lines=new JTextPane();
  lines.setSize(30,50);
  lines.setContentType("text/html");
  lines.setMargin(new Insets(5,5,5,5));
  lines.setEditable(false);
  JScrollPane utterancesScrollPane=new JScrollPane(lines);
  DefaultCaret caret=(DefaultCaret)lines.getCaret();
  caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);
  inputContainer=new Container();
  inputContainer.setLayout(new BorderLayout());
  inputField=new JTextField(60);
  inputContainer.add(new JLabel("Input: "),BorderLayout.WEST);
  inputContainer.add(inputField,BorderLayout.CENTER);
  final JButton helpButton=new JButton("");
  helpButton.putClientProperty("JButton.buttonType","help");
  final BalloonTip tip=new BalloonTip(helpButton,TIP_TEXT);
  tip.setVisible(false);
  helpButton.addActionListener(null);
  helpButton.setFocusable(false);
  inputContainer.add(helpButton,BorderLayout.EAST);
  add(inputContainer,BorderLayout.SOUTH);
  add(utterancesScrollPane,BorderLayout.CENTER);
  inputField.addActionListener(null);
  kit=new HTMLEditorKit();
  doc=new HTMLDocument();
  lines.setEditorKit(kit);
  lines.setDocument(doc);
  refresh();
  if (system.getModule(GUIFrame.class).isSpeechEnabled) {
    enableSpeech(true);
  }
}

public InteractionTab ( DialogueSystem system ) { this . system = system ; setLayout ( new BorderLayout ( ) ) ; lines = new JTextPane ( ) ; lines . setSize ( 30 , 50 ) ; lines . setContentType ( "text/html" ) ; lines . setMargin ( new Insets ( 5 , 5 , 5 , 5 ) ) ; lines . setEditable ( false ) ; JScrollPane utterancesScrollPane = new JScrollPane ( lines ) ; DefaultCaret caret = ( DefaultCaret ) lines . getCaret ( ) ; caret . setUpdatePolicy ( DefaultCaret . ALWAYS_UPDATE ) ; inputContainer = new Container ( ) ; inputContainer . setLayout ( new BorderLayout ( ) ) ; inputField = new JTextField ( 60 ) ; inputContainer . add ( new JLabel ( "Input: " ) , BorderLayout . WEST ) ; inputContainer . add ( inputField , BorderLayout . CENTER ) ; final JButton helpButton = new JButton ( "" ) ; helpButton . putClientProperty ( "JButton.buttonType" , "help" ) ; final BalloonTip tip = new BalloonTip ( helpButton , TIP_TEXT ) ; tip . setVisible ( false ) ; helpButton . addActionListener ( null ) ; helpButton . setFocusable ( false ) ; inputContainer . add ( helpButton , BorderLayout . EAST ) ; add ( inputContainer , BorderLayout . SOUTH ) ; add ( utterancesScrollPane , BorderLayout . CENTER ) ; inputField . addActionListener ( null ) ; kit = new HTMLEditorKit ( ) ; doc = new HTMLDocument ( ) ; lines . setEditorKit ( kit ) ; lines . setDocument ( doc ) ; refresh ( ) ; if ( system . getModule ( GUIFrame . class ) . isSpeechEnabled ) { enableSpeech ( true ) ; } }
start up the window
