aboutsummaryrefslogtreecommitdiff
path: root/pbfi/pbfi-1.0/src/Frame.java
blob: 30f7f3c9ee3aea1c134f501fc7ae3dcee6f6cddc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
Copyright 2009 Sebastiano Tronto <sebastiano@luganega.org>

This file is part of PBFI (Porky's Brain F*** Interpreter).

    PBFI is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    PBFI is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with PBFI; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

*/

import javax.swing.JFrame;
import javax.swing.JButton;
import javax.swing.JTextArea;
import javax.swing.JScrollPane;
import java.awt.BorderLayout;
import java.awt.event.*;

public class Frame extends JFrame {
	public static Main main;
	public static JTextArea textArea;
	public static JButton runButton;
	public Frame() {
		super( "Porky's Brain F*** Interpreter - v1.0" );
		main = new Main();
		textArea = new JTextArea( "Brain F*** source code here", 15, 15 );
		runButton = new JButton( "Run" );
		runButton.addActionListener(
			new ActionListener() {
				public void actionPerformed( ActionEvent e ) {
					main.run( textArea.getText() );
				}
			}
		);
		setLayout( new BorderLayout() );
		add( new JScrollPane( textArea ), BorderLayout.CENTER );
		add( runButton, BorderLayout.SOUTH );
	}
}

Generated with cgit - Back to sebastiano.tronto.net