// GUI PARA LA EVALUACION DE EXPRESIONES ARITMETICAS
import java.awt.event.*;
import javax.swing.JFrame;
import javax.swing.JTextField;
import javax.swing.JButton;
import java.awt.Color;
import java.awt.Font;
public class Ventana extends JFrame
{
JTextField JTF = new JTextField();
JButton JB = new JButton("EVALUA");
JTextField RESP = new JTextField();
Font Fuente = new Font("Arial Bold", Font.BOLD, 30);
public static void main(String ARGS[]) { new Ventana(); }
public Ventana()
{
setLayout( null );
this.setBounds(30, 50, 600, 300);
setBackground(Color.red);
setVisible(true);
add(JTF); JTF.setBounds(50, 50, 200, 50); JTF.setBackground(Color.green);
JTF.setFont(Fuente); JTF.setForeground(Color.blue);
add(JB); JB.setBounds(300, 50, 100, 50); JB.addActionListener( new BOTON() );
add(RESP); RESP.setBounds(350, 150, 100, 100); RESP.setFont(Fuente);
RESP.setForeground(Color.blue); RESP.setBackground(Color.green);
}
protected void processWindowEvent(WindowEvent e)
{ if (e.getID() == WindowEvent.WINDOW_CLOSING) System.exit(0); }
class BOTON implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
Operaciones OPR = new Operaciones(JTF.getText());
int RESPUESTA = OPR.RecorreCadena();
RESP.setText(""+RESPUESTA);
}
}
}