OSDN Git Service

入力パネルクリアボタン実装
authoryukihane <yukihane.feather@gmail.com>
Fri, 2 Sep 2011 07:37:48 +0000 (16:37 +0900)
committeryukihane <yukihane.feather@gmail.com>
Fri, 9 Sep 2011 11:39:49 +0000 (20:39 +0900)
frontend/src/yukihane/inqubus/gui/MainFrame.java

index 23a2fa0..fe11635 100644 (file)
@@ -201,6 +201,13 @@ public class MainFrame extends JFrame {
         btnStop.addActionListener(new StopActionListener());
         final ApplyActionListener applyListener = new ApplyActionListener();
         btnApply.addActionListener(applyListener);
+        btnClear.addActionListener(new ActionListener() {
+
+            @Override
+            public void actionPerformed(ActionEvent e) {
+                initInputPanel();
+            }
+        });
 
         pnlMain.setBorder(BorderFactory.createEtchedBorder());
 
@@ -402,6 +409,8 @@ public class MainFrame extends JFrame {
             .addContainerGap()
             .addComponent(fldInputMessage, GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE)
             .addPreferredGap(ComponentPlacement.UNRELATED)
+            .addComponent(btnClear)
+            .addPreferredGap(ComponentPlacement.UNRELATED)
             .addComponent(btnApply)
             .addContainerGap()
         );
@@ -409,6 +418,7 @@ public class MainFrame extends JFrame {
             .addContainerGap()
             .addGroup(glInputButton.createParallelGroup(Alignment.BASELINE)
                 .addComponent(fldInputMessage, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
+                .addComponent(btnClear)
                 .addComponent(btnApply)
             )
             .addContainerGap()
@@ -668,6 +678,7 @@ public class MainFrame extends JFrame {
     private final FfmpegParamPanel pnlInputFfmpeg = new FfmpegParamPanel();
     // 適用
     private final JTextField fldInputMessage = new JTextField();
+    private final JButton btnClear = new JButton("クリア");
     private final JButton btnApply = new JButton("適用");
     // End of variables declaration//GEN-END:variables