aboutsummaryrefslogtreecommitdiffstats
path: root/ardor3d-examples
diff options
context:
space:
mode:
authorJoshua Slack <[email protected]>2017-10-19 11:25:34 -0500
committerJoshua Slack <[email protected]>2017-10-19 11:25:34 -0500
commit57bb9ed523b3a47a358a6348bce052eaff88fe97 (patch)
treef6fde745c06eb8fc1db653bd14c59f4473118b48 /ardor3d-examples
parent667f946d11b29f9d6618b46d7b821099f6a83b77 (diff)
Small tweak to fix scroll bug in example
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();
}
}