public class REDemo extends Applet implements TextListener
{
...fieldRE.addTextListener(this);
fieldMatch.addTextListener(this);
// Initial UI update
textValueChanged(null);
....
public void textValueChanged(TextEvent e)
{
// If it's a generic update or the regexp changed...
if (e == null || e.getSource() == fieldRE)
{
// Update regexp
updateRE(fieldRE.getText());
} // We always need to update the match results
updateMatch(fieldMatch.getText());
}
...
}
{
...fieldRE.addTextListener(this);
fieldMatch.addTextListener(this);
// Initial UI update
textValueChanged(null);
....
public void textValueChanged(TextEvent e)
{
// If it's a generic update or the regexp changed...
if (e == null || e.getSource() == fieldRE)
{
// Update regexp
updateRE(fieldRE.getText());
} // We always need to update the match results
updateMatch(fieldMatch.getText());
}
...
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货