/* Copyright 2009 Sebastiano Tronto 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 ); } }