aboutsummaryrefslogtreecommitdiffstats
path: root/ardor3d-examples
diff options
context:
space:
mode:
Diffstat (limited to 'ardor3d-examples')
-rw-r--r--ardor3d-examples/src/main/java/com/ardor3d/example/ui/SimpleUIExample.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/ardor3d-examples/src/main/java/com/ardor3d/example/ui/SimpleUIExample.java b/ardor3d-examples/src/main/java/com/ardor3d/example/ui/SimpleUIExample.java
index 0ecc8ad..86044ac 100644
--- a/ardor3d-examples/src/main/java/com/ardor3d/example/ui/SimpleUIExample.java
+++ b/ardor3d-examples/src/main/java/com/ardor3d/example/ui/SimpleUIExample.java
@@ -202,7 +202,7 @@ public class SimpleUIExample extends ExampleBase {
final ActionListener actionListener = new ActionListener() {
public void actionPerformed(final ActionEvent event) {
- applyChat(historyArea, chatField);
+ applyChat(historyArea, chatField, scrollArea);
}
};
chatButton.addActionListener(actionListener);
@@ -217,11 +217,12 @@ public class SimpleUIExample extends ExampleBase {
return chatPanel;
}
- private void applyChat(final UITextArea historyArea, final UITextField chatField) {
+ private void applyChat(final UITextArea historyArea, final UITextField chatField, final UIScrollPanel scrollArea) {
final String text = chatField.getText();
if (text.length() > 0) {
historyArea.setText(historyArea.getText() + "\n" + text);
chatField.setText("");
+ scrollArea.layout();
}
}