OSDN Git Service

NGワード登録時, 登録した情報が見えるようにスクロールする
[coroid/inqubus.git] / frontend / src / yukihane / inqubus / gui / NgRegisterPanel.java
index acbd2cf..178e27c 100644 (file)
@@ -74,7 +74,7 @@ class NgRegisterPanel extends JPanel {
             gl.createParallelGroup(Alignment.LEADING)
             .addGroup(gl.createSequentialGroup()
                 .addContainerGap()
-                .addComponent(scrNgWord, GroupLayout.PREFERRED_SIZE, 100, GroupLayout.PREFERRED_SIZE)
+                .addComponent(scrNgWord, GroupLayout.PREFERRED_SIZE, 100, Short.MAX_VALUE)
                 .addPreferredGap(ComponentPlacement.RELATED)
                 .addGroup(gl.createParallelGroup(Alignment.BASELINE)
                     .addComponent(fldNgWord, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
@@ -89,12 +89,13 @@ class NgRegisterPanel extends JPanel {
 
         @Override
         public void actionPerformed(ActionEvent e) {
-        final String w = fldNgWord.getText();
-        if (StringUtils.isBlank(w)) {
-            return;
-        }
-        mdlNgWord.addElement(w);
-        fldNgWord.setText("");
+            final String w = fldNgWord.getText();
+            if (StringUtils.isBlank(w)) {
+                return;
+            }
+            mdlNgWord.addElement(w);
+            lstNgWord.ensureIndexIsVisible(mdlNgWord.getSize() - 1);
+            fldNgWord.setText("");
         }
     }