01: package method;
02:
03: import java.awt.event.FocusEvent;
04: import javax.swing.JTextField;
05: import javax.swing.SwingUtilities;
06:
07: public class ExtractMethodTestFive {
08: void firewallNameField_focusLost(FocusEvent e) {
09: System.out.println("Before");
10: SwingUtilities.invokeLater(new Runnable() {
11: public void run() {
12: actualFilename.setText(computeFile());
13: actualFilename.revalidate();
14: }
15: });
16: System.out.println("After");
17: }
18:
19: private JTextField actualFilename;
20:
21: public String computeFile() {
22: return "c:\\temp\\notes.txt";
23: }
24:
25: class Inner {
26: public void test() {
27: Matcher _matcher;
28:
29: _matcher.init();
30: // Gobble up any whitespace between attributes
31: while (_matcher.match(new char[] { ' ', '\t' })) {
32: _matcher.consume();
33: }
34: _matcher.done();
35: }
36: }
37: }
|