From 57bb9ed523b3a47a358a6348bce052eaff88fe97 Mon Sep 17 00:00:00 2001 From: Joshua Slack Date: Thu, 19 Oct 2017 11:25:34 -0500 Subject: Small tweak to fix scroll bug in example --- .../src/main/java/com/ardor3d/example/ui/SimpleUIExample.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ardor3d-examples') 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(); } } -- cgit v1.2.3