historyArea.setStyledText(true);
historyArea.setAlignment(Alignment.BOTTOM_LEFT);
historyArea.setEditable(false);
final UIScrollPanel scrollArea = new UIScrollPanel(historyArea);
scrollArea.setLayoutData(BorderLayoutData.CENTER);
final UITextField chatField = new UITextField();
chatField.setLayoutData(BorderLayoutData.CENTER);
final UIButton chatButton = new UIButton("SAY");
chatButton.setLayoutData(BorderLayoutData.EAST);
final ActionListener actionListener = new ActionListener() {
public void actionPerformed(final ActionEvent event) {
applyChat(historyArea, chatField);
}
};
chatButton.addActionListener(actionListener);
chatField.addActionListener(actionListener);
bottomPanel.add(chatField);
bottomPanel.add(chatButton);
chatPanel.add(dirLabel);