2006-11-26 16:17:51 +00:00
|
|
|
package ase.test.awk;
|
|
|
|
|
|
|
|
import java.applet.*;
|
|
|
|
import java.awt.*;
|
|
|
|
import java.awt.event.*;
|
|
|
|
|
2007-01-25 14:14:56 +00:00
|
|
|
|
2006-11-26 16:17:51 +00:00
|
|
|
public class AwkApplet extends Applet
|
|
|
|
{
|
|
|
|
public void init ()
|
|
|
|
{
|
|
|
|
Button btn_run;
|
|
|
|
btn_run = new Button ("Run Awk");
|
|
|
|
|
|
|
|
btn_run.addActionListener (new ActionListener ()
|
|
|
|
{
|
|
|
|
public void actionPerformed (ActionEvent e)
|
|
|
|
{
|
|
|
|
run_awk ();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
add (btn_run);
|
|
|
|
}
|
|
|
|
|
|
|
|
public void stop () {}
|
|
|
|
public void paint (Graphics g) {}
|
|
|
|
|
|
|
|
private void run_awk ()
|
|
|
|
{
|
|
|
|
Awk awk = null;
|
|
|
|
|
|
|
|
try
|
|
|
|
{
|
|
|
|
awk = new Awk ();
|
|
|
|
awk.parse ();
|
|
|
|
awk.run ();
|
|
|
|
}
|
|
|
|
catch (ase.awk.Exception e)
|
|
|
|
{
|
|
|
|
System.out.println ("ase.awk.Exception - " + e.getMessage());
|
|
|
|
}
|
|
|
|
finally
|
|
|
|
{
|
|
|
|
if (awk != null) awk.close ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|