Contenedores.java



// SUMA DE MATRICES EN 3 PANELES
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;


class Contenedores extends JFrame
{
	Cartulina C = new Cartulina();


	public static void main(String R[]) { new Contenedores(); }

	public Contenedores()
	{
		setBounds(100, 100, 1000, 600); setVisible(true); setLayout(null);

		add(C); C.setBounds(0, 0, 1000, 600);
	}

	protected void processWindowEvent(WindowEvent e)
        { if (e.getID() == WindowEvent.WINDOW_CLOSING) System.exit(0); }
}

class Cartulina extends JPanel
{
	Hoja OPR1, OPR2, RESP;
	JButton CLR1, CLR2, IGUAL;
	String Dato11="";

	public Cartulina()
	{
		setLayout(null);
		OPR1 = new Hoja(); add(OPR1); OPR1.setBounds(10, 20, 200, 400);
		CLR1 = new JButton("CLEAR"); add(CLR1);
		CLR1.setBounds(70, 450, 100, 50);
		CLR1.addActionListener( new CLICK() );
	}

	class CLICK implements ActionListener
	{
		public void actionPerformed(ActionEvent e)
		{
			//Dato11 = OPR1.R1C1.getText();
			OPR1.R1C1.setText("");
		}
	}
}


class Hoja extends JPanel
{
	JTextField R1C1, R1C2, R2C1, R2C2;
	Font F;

	public Hoja()
	{
		setLayout(new GridLayout(2, 2));
		F = new Font("Arial Bold", Font.ITALIC, 50);
		R1C1 = new JTextField(10); R1C2 = new JTextField(10);
		R2C1 = new JTextField(10); R2C2 = new JTextField(10);
		add(R1C1); add(R1C2); add(R2C1); add(R2C2);
		R1C1.setFont(F);
	}
}