[Patchanim-commit] SF.net SVN: patchanim: [182] trunk/patchanim/src/com/mebigfatguy/patchanim/ gui/
Brought to you by:
dbrosius
From: <dbr...@us...> - 2008-02-14 05:06:27
|
Revision: 182 http://patchanim.svn.sourceforge.net/patchanim/?rev=182&view=rev Author: dbrosius Date: 2008-02-13 21:06:32 -0800 (Wed, 13 Feb 2008) Log Message: ----------- select control text fields on focus Modified Paths: -------------- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchControlPanel.java Modified: trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchControlPanel.java =================================================================== --- trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchControlPanel.java 2008-02-14 04:58:33 UTC (rev 181) +++ trunk/patchanim/src/com/mebigfatguy/patchanim/gui/JPatchControlPanel.java 2008-02-14 05:06:32 UTC (rev 182) @@ -23,6 +23,7 @@ import java.awt.event.ActionListener; import java.awt.event.FocusAdapter; import java.awt.event.FocusEvent; +import java.awt.event.FocusListener; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.util.ResourceBundle; @@ -163,10 +164,9 @@ } }); - widthField.addFocusListener(new FocusAdapter() { + widthField.addFocusListener(new FocusListener() { - @Override - public void focusLost(FocusEvent arg0) { + public void focusLost(FocusEvent fe) { try { int oldWidth = document.getWidth(); int newWidth = Integer.parseInt(widthField.getText()); @@ -181,11 +181,15 @@ mediator.fireSettingsChanged(); } } + + public void focusGained(FocusEvent fe) { + widthField.setSelectionStart(0); + widthField.setSelectionEnd(Integer.MAX_VALUE); + } }); - heightField.addFocusListener(new FocusAdapter() { + heightField.addFocusListener(new FocusListener() { - @Override public void focusLost(FocusEvent arg0) { try { int oldHeight = document.getHeight(); @@ -201,6 +205,11 @@ mediator.fireSettingsChanged(); } } + + public void focusGained(FocusEvent fe) { + heightField.setSelectionStart(0); + heightField.setSelectionEnd(Integer.MAX_VALUE); + } }); tweenFramesField.addFocusListener(new FocusAdapter() { @@ -245,6 +254,14 @@ } }); + tweenFramesField.addFocusListener(new FocusAdapter() { + @Override + public void focusGained(FocusEvent fe) { + tweenFramesField.setSelectionStart(0); + tweenFramesField.setSelectionEnd(Integer.MAX_VALUE); + } + }); + testButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent ae) { JTestFrame tf = new JTestFrame(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |