SlideShare a Scribd company logo
1 of 2
Download to read offline
Creating the GUI was not an issue, I am having an issue creating the implementation.
import javax.swing.*;
import java.awt.event.*;
import java.io.*;
import java.util.*;
public class Lab2 extends JFrame implements ActionListener {
JButton open = new JButton("Next Program");
JTextArea result = new JTextArea(20,40);
JLabel errors = new JLabel();
JScrollPane scroller = new JScrollPane();
public Lab2() {
setLayout(new java.awt.FlowLayout());
setSize(500,430);
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
add(open); open.addActionListener(this);
scroller.getViewport().add(result);
add(scroller);
add(errors);
}
public void actionPerformed(ActionEvent evt) {
result.setText(""); //clear TextArea for next program
errors.setText("");
processProgram();
}
public static void main(String[] args) {
Lab2 display = new Lab2();
display.setVisible(true);
}
String getFileName() {
JFileChooser fc = new JFileChooser();
int returnVal = fc.showOpenDialog(this);
if (returnVal == JFileChooser.APPROVE_OPTION)
return fc.getSelectedFile().getPath();
else
return null;
}
/************************************************************************/
/* Put your implementation of the processProgram method here. */
/* Use the getFileName method to allow the user to select a program. */
/* Then simulate the execution of that program. */
/* You may add any other methods that you think are appropriate. */
/* However, you should not change anything in the code that I have */
/* written. */
/************************************************************************/
Write a Java program to read and simulate the execution of a program written in a highly
simplified programming language. Each line in the input contains one statement. There are no
declaration statements; all values are of type double. Statements in the language are in the
following forms: Conditional Statement Meaning begin{tabular}{|l|l|} IF variable IS value
THEN simpleStatement &
Ifthevariableisequaltovalue(avariableoraconstant),thesimpleStatementisperformed.  hline
end{tabular} The GUI will include a "Next Program" button which allows the user to select a
file containing a program to be executed. The program in the selected file is then executed and
the output (result of the PRINT statements) should be displayed in a scrollable text area. NOTE
Use of an array is NOT acceptable in this assignment.

More Related Content

Similar to Creating the GUI was not an issue, I am having an issue creating the.pdf

How do I make my JTable non editableimport java.awt.; import j.pdf
How do I make my JTable non editableimport java.awt.; import j.pdfHow do I make my JTable non editableimport java.awt.; import j.pdf
How do I make my JTable non editableimport java.awt.; import j.pdfforwardcom41
 
Groovy-er desktop applications with Griffon
Groovy-er desktop applications with GriffonGroovy-er desktop applications with Griffon
Groovy-er desktop applications with GriffonEric Wendelin
 
Groovy-er Desktop Applications With Griffon
Groovy-er Desktop Applications With GriffonGroovy-er Desktop Applications With Griffon
Groovy-er Desktop Applications With GriffonMatthew McCullough
 
In Java Write a GUI application to simulate writing out a check. The.pdf
In Java Write a GUI application to simulate writing out a check. The.pdfIn Java Write a GUI application to simulate writing out a check. The.pdf
In Java Write a GUI application to simulate writing out a check. The.pdfflashfashioncasualwe
 
Write a GUI application to simulate writing out a check. The value o.pdf
Write a GUI application to simulate writing out a check. The value o.pdfWrite a GUI application to simulate writing out a check. The value o.pdf
Write a GUI application to simulate writing out a check. The value o.pdffathimaoptical
 
correct the error and add code same in the pic import jav.pdf
correct the error and add code same in the pic   import jav.pdfcorrect the error and add code same in the pic   import jav.pdf
correct the error and add code same in the pic import jav.pdfdevangmittal4
 
package net.codejava.swing.mail;import java.awt.Font;import java.pdf
package net.codejava.swing.mail;import java.awt.Font;import java.pdfpackage net.codejava.swing.mail;import java.awt.Font;import java.pdf
package net.codejava.swing.mail;import java.awt.Font;import java.pdfsudhirchourasia86
 
import java.awt.FlowLayout;import java.awt.event.KeyEvent;import.pdf
import java.awt.FlowLayout;import java.awt.event.KeyEvent;import.pdfimport java.awt.FlowLayout;import java.awt.event.KeyEvent;import.pdf
import java.awt.FlowLayout;import java.awt.event.KeyEvent;import.pdfgalagirishp
 
Exercícios Netbeans - Vera Cymbron
Exercícios Netbeans - Vera CymbronExercícios Netbeans - Vera Cymbron
Exercícios Netbeans - Vera Cymbroncymbron
 
ViewerFrame.java import javax.swing.JFrame;public class Viewer.pdf
ViewerFrame.java import javax.swing.JFrame;public class Viewer.pdfViewerFrame.java import javax.swing.JFrame;public class Viewer.pdf
ViewerFrame.java import javax.swing.JFrame;public class Viewer.pdfannaindustries
 
Assignment InstructionsInstructions Make sure you go t
Assignment InstructionsInstructions Make sure you go tAssignment InstructionsInstructions Make sure you go t
Assignment InstructionsInstructions Make sure you go twiddowsonerica
 
Basic using of Swing in Java
Basic using of Swing in JavaBasic using of Swing in Java
Basic using of Swing in Javasuraj pandey
 
import java.applet.; import java.awt.; import java.awt.event.A.pdf
import java.applet.; import java.awt.; import java.awt.event.A.pdfimport java.applet.; import java.awt.; import java.awt.event.A.pdf
import java.applet.; import java.awt.; import java.awt.event.A.pdfapnafreez
 
T.Y.B.S.CS Advance Java Practicals Sem 5 Mumbai University
T.Y.B.S.CS Advance Java Practicals Sem 5 Mumbai UniversityT.Y.B.S.CS Advance Java Practicals Sem 5 Mumbai University
T.Y.B.S.CS Advance Java Practicals Sem 5 Mumbai UniversityNiraj Bharambe
 
Chat application in java using swing and socket programming.
Chat application in java using swing and socket programming.Chat application in java using swing and socket programming.
Chat application in java using swing and socket programming.Kuldeep Jain
 
The sample program for above series in JAVA will be like belowimpo.pdf
The sample program for above series in JAVA will be like belowimpo.pdfThe sample program for above series in JAVA will be like belowimpo.pdf
The sample program for above series in JAVA will be like belowimpo.pdfrajat630669
 

Similar to Creating the GUI was not an issue, I am having an issue creating the.pdf (20)

How do I make my JTable non editableimport java.awt.; import j.pdf
How do I make my JTable non editableimport java.awt.; import j.pdfHow do I make my JTable non editableimport java.awt.; import j.pdf
How do I make my JTable non editableimport java.awt.; import j.pdf
 
Groovy-er desktop applications with Griffon
Groovy-er desktop applications with GriffonGroovy-er desktop applications with Griffon
Groovy-er desktop applications with Griffon
 
Groovy-er Desktop Applications With Griffon
Groovy-er Desktop Applications With GriffonGroovy-er Desktop Applications With Griffon
Groovy-er Desktop Applications With Griffon
 
Tuto jtatoo
Tuto jtatooTuto jtatoo
Tuto jtatoo
 
GUI Programming with Java
GUI Programming with JavaGUI Programming with Java
GUI Programming with Java
 
In Java Write a GUI application to simulate writing out a check. The.pdf
In Java Write a GUI application to simulate writing out a check. The.pdfIn Java Write a GUI application to simulate writing out a check. The.pdf
In Java Write a GUI application to simulate writing out a check. The.pdf
 
Write a GUI application to simulate writing out a check. The value o.pdf
Write a GUI application to simulate writing out a check. The value o.pdfWrite a GUI application to simulate writing out a check. The value o.pdf
Write a GUI application to simulate writing out a check. The value o.pdf
 
correct the error and add code same in the pic import jav.pdf
correct the error and add code same in the pic   import jav.pdfcorrect the error and add code same in the pic   import jav.pdf
correct the error and add code same in the pic import jav.pdf
 
package net.codejava.swing.mail;import java.awt.Font;import java.pdf
package net.codejava.swing.mail;import java.awt.Font;import java.pdfpackage net.codejava.swing.mail;import java.awt.Font;import java.pdf
package net.codejava.swing.mail;import java.awt.Font;import java.pdf
 
import java.awt.FlowLayout;import java.awt.event.KeyEvent;import.pdf
import java.awt.FlowLayout;import java.awt.event.KeyEvent;import.pdfimport java.awt.FlowLayout;import java.awt.event.KeyEvent;import.pdf
import java.awt.FlowLayout;import java.awt.event.KeyEvent;import.pdf
 
Exercícios Netbeans - Vera Cymbron
Exercícios Netbeans - Vera CymbronExercícios Netbeans - Vera Cymbron
Exercícios Netbeans - Vera Cymbron
 
662305 11
662305 11662305 11
662305 11
 
ViewerFrame.java import javax.swing.JFrame;public class Viewer.pdf
ViewerFrame.java import javax.swing.JFrame;public class Viewer.pdfViewerFrame.java import javax.swing.JFrame;public class Viewer.pdf
ViewerFrame.java import javax.swing.JFrame;public class Viewer.pdf
 
Assignment InstructionsInstructions Make sure you go t
Assignment InstructionsInstructions Make sure you go tAssignment InstructionsInstructions Make sure you go t
Assignment InstructionsInstructions Make sure you go t
 
Basic using of Swing in Java
Basic using of Swing in JavaBasic using of Swing in Java
Basic using of Swing in Java
 
import java.applet.; import java.awt.; import java.awt.event.A.pdf
import java.applet.; import java.awt.; import java.awt.event.A.pdfimport java.applet.; import java.awt.; import java.awt.event.A.pdf
import java.applet.; import java.awt.; import java.awt.event.A.pdf
 
T.Y.B.S.CS Advance Java Practicals Sem 5 Mumbai University
T.Y.B.S.CS Advance Java Practicals Sem 5 Mumbai UniversityT.Y.B.S.CS Advance Java Practicals Sem 5 Mumbai University
T.Y.B.S.CS Advance Java Practicals Sem 5 Mumbai University
 
Chat application in java using swing and socket programming.
Chat application in java using swing and socket programming.Chat application in java using swing and socket programming.
Chat application in java using swing and socket programming.
 
Java awt
Java awtJava awt
Java awt
 
The sample program for above series in JAVA will be like belowimpo.pdf
The sample program for above series in JAVA will be like belowimpo.pdfThe sample program for above series in JAVA will be like belowimpo.pdf
The sample program for above series in JAVA will be like belowimpo.pdf
 

More from ameerandsons

Culturas de mercado A) Empoderar a los empleados para que asuman .pdf
Culturas de mercado A) Empoderar a los empleados para que asuman .pdfCulturas de mercado A) Empoderar a los empleados para que asuman .pdf
Culturas de mercado A) Empoderar a los empleados para que asuman .pdfameerandsons
 
Current Event #2 - summarize a recent business article from a source.pdf
Current Event #2 - summarize a recent business article from a source.pdfCurrent Event #2 - summarize a recent business article from a source.pdf
Current Event #2 - summarize a recent business article from a source.pdfameerandsons
 
cultura y diversidad 1. Paralenguaje se refiere a a. Contacto vi.pdf
cultura y diversidad 1. Paralenguaje se refiere a a. Contacto vi.pdfcultura y diversidad 1. Paralenguaje se refiere a a. Contacto vi.pdf
cultura y diversidad 1. Paralenguaje se refiere a a. Contacto vi.pdfameerandsons
 
Cryptography13.Consider the following matrix with entries from E,.pdf
Cryptography13.Consider the following matrix with entries from E,.pdfCryptography13.Consider the following matrix with entries from E,.pdf
Cryptography13.Consider the following matrix with entries from E,.pdfameerandsons
 
Cuatro tendencias principales que afectan el comercio mundial a prin.pdf
Cuatro tendencias principales que afectan el comercio mundial a prin.pdfCuatro tendencias principales que afectan el comercio mundial a prin.pdf
Cuatro tendencias principales que afectan el comercio mundial a prin.pdfameerandsons
 
Cuando una encuesta mide el compromiso de los empleados de una organ.pdf
Cuando una encuesta mide el compromiso de los empleados de una organ.pdfCuando una encuesta mide el compromiso de los empleados de una organ.pdf
Cuando una encuesta mide el compromiso de los empleados de una organ.pdfameerandsons
 
Cuenta Saldo 31122013 Saldo 31122014 Depreciaci�n acumulada $2.pdf
Cuenta Saldo 31122013 Saldo 31122014 Depreciaci�n acumulada $2.pdfCuenta Saldo 31122013 Saldo 31122014 Depreciaci�n acumulada $2.pdf
Cuenta Saldo 31122013 Saldo 31122014 Depreciaci�n acumulada $2.pdfameerandsons
 
Cuando una empresa instala filiales que producen algunos de los insu.pdf
Cuando una empresa instala filiales que producen algunos de los insu.pdfCuando una empresa instala filiales que producen algunos de los insu.pdf
Cuando una empresa instala filiales que producen algunos de los insu.pdfameerandsons
 
Cuando un proceso no est� bajo control que significa No est� haci.pdf
Cuando un proceso no est� bajo control que significa No est� haci.pdfCuando un proceso no est� bajo control que significa No est� haci.pdf
Cuando un proceso no est� bajo control que significa No est� haci.pdfameerandsons
 
Cuando un proyectil (una roca del espacio, digamos) golpea la superf.pdf
Cuando un proyectil (una roca del espacio, digamos) golpea la superf.pdfCuando un proyectil (una roca del espacio, digamos) golpea la superf.pdf
Cuando un proyectil (una roca del espacio, digamos) golpea la superf.pdfameerandsons
 
Cuando se trata de evaluaciones de desempe�o, los supervisores y los.pdf
Cuando se trata de evaluaciones de desempe�o, los supervisores y los.pdfCuando se trata de evaluaciones de desempe�o, los supervisores y los.pdf
Cuando se trata de evaluaciones de desempe�o, los supervisores y los.pdfameerandsons
 
Cuando los lobos regresaron por primera vez a Yellowstone, las pobla.pdf
Cuando los lobos regresaron por primera vez a Yellowstone, las pobla.pdfCuando los lobos regresaron por primera vez a Yellowstone, las pobla.pdf
Cuando los lobos regresaron por primera vez a Yellowstone, las pobla.pdfameerandsons
 
Cuando Joe maximiza la utilidad, encuentra que su MRS de X por Y (o .pdf
Cuando Joe maximiza la utilidad, encuentra que su MRS de X por Y (o .pdfCuando Joe maximiza la utilidad, encuentra que su MRS de X por Y (o .pdf
Cuando Joe maximiza la utilidad, encuentra que su MRS de X por Y (o .pdfameerandsons
 
Cuando el suministro es de inter�s p�blico Roche y Tamiflu El caso .pdf
Cuando el suministro es de inter�s p�blico Roche y Tamiflu El caso .pdfCuando el suministro es de inter�s p�blico Roche y Tamiflu El caso .pdf
Cuando el suministro es de inter�s p�blico Roche y Tamiflu El caso .pdfameerandsons
 
Cuando escuchas la palabra liderazgo, �qu� te viene a la mente Co.pdf
Cuando escuchas la palabra liderazgo, �qu� te viene a la mente Co.pdfCuando escuchas la palabra liderazgo, �qu� te viene a la mente Co.pdf
Cuando escuchas la palabra liderazgo, �qu� te viene a la mente Co.pdfameerandsons
 
Cuando el fago lambda de tipo salvaje se sembra en placas en un c�sp.pdf
Cuando el fago lambda de tipo salvaje se sembra en placas en un c�sp.pdfCuando el fago lambda de tipo salvaje se sembra en placas en un c�sp.pdf
Cuando el fago lambda de tipo salvaje se sembra en placas en un c�sp.pdfameerandsons
 
Cualquier ayuda es bienvenida. Jayne Butterfield, una madre solter.pdf
Cualquier ayuda es bienvenida. Jayne Butterfield, una madre solter.pdfCualquier ayuda es bienvenida. Jayne Butterfield, una madre solter.pdf
Cualquier ayuda es bienvenida. Jayne Butterfield, una madre solter.pdfameerandsons
 
CS520 Computer Architecture Project 2 � Spring 2023 Due date 0326.pdf
CS520 Computer Architecture Project 2 � Spring 2023 Due date 0326.pdfCS520 Computer Architecture Project 2 � Spring 2023 Due date 0326.pdf
CS520 Computer Architecture Project 2 � Spring 2023 Due date 0326.pdfameerandsons
 
Cross-cultural industrial and organizational psychology. Citation Tr.pdf
Cross-cultural industrial and organizational psychology. Citation Tr.pdfCross-cultural industrial and organizational psychology. Citation Tr.pdf
Cross-cultural industrial and organizational psychology. Citation Tr.pdfameerandsons
 
Cryptography is designed to turn information into a format that is d.pdf
Cryptography is designed to turn information into a format that is d.pdfCryptography is designed to turn information into a format that is d.pdf
Cryptography is designed to turn information into a format that is d.pdfameerandsons
 

More from ameerandsons (20)

Culturas de mercado A) Empoderar a los empleados para que asuman .pdf
Culturas de mercado A) Empoderar a los empleados para que asuman .pdfCulturas de mercado A) Empoderar a los empleados para que asuman .pdf
Culturas de mercado A) Empoderar a los empleados para que asuman .pdf
 
Current Event #2 - summarize a recent business article from a source.pdf
Current Event #2 - summarize a recent business article from a source.pdfCurrent Event #2 - summarize a recent business article from a source.pdf
Current Event #2 - summarize a recent business article from a source.pdf
 
cultura y diversidad 1. Paralenguaje se refiere a a. Contacto vi.pdf
cultura y diversidad 1. Paralenguaje se refiere a a. Contacto vi.pdfcultura y diversidad 1. Paralenguaje se refiere a a. Contacto vi.pdf
cultura y diversidad 1. Paralenguaje se refiere a a. Contacto vi.pdf
 
Cryptography13.Consider the following matrix with entries from E,.pdf
Cryptography13.Consider the following matrix with entries from E,.pdfCryptography13.Consider the following matrix with entries from E,.pdf
Cryptography13.Consider the following matrix with entries from E,.pdf
 
Cuatro tendencias principales que afectan el comercio mundial a prin.pdf
Cuatro tendencias principales que afectan el comercio mundial a prin.pdfCuatro tendencias principales que afectan el comercio mundial a prin.pdf
Cuatro tendencias principales que afectan el comercio mundial a prin.pdf
 
Cuando una encuesta mide el compromiso de los empleados de una organ.pdf
Cuando una encuesta mide el compromiso de los empleados de una organ.pdfCuando una encuesta mide el compromiso de los empleados de una organ.pdf
Cuando una encuesta mide el compromiso de los empleados de una organ.pdf
 
Cuenta Saldo 31122013 Saldo 31122014 Depreciaci�n acumulada $2.pdf
Cuenta Saldo 31122013 Saldo 31122014 Depreciaci�n acumulada $2.pdfCuenta Saldo 31122013 Saldo 31122014 Depreciaci�n acumulada $2.pdf
Cuenta Saldo 31122013 Saldo 31122014 Depreciaci�n acumulada $2.pdf
 
Cuando una empresa instala filiales que producen algunos de los insu.pdf
Cuando una empresa instala filiales que producen algunos de los insu.pdfCuando una empresa instala filiales que producen algunos de los insu.pdf
Cuando una empresa instala filiales que producen algunos de los insu.pdf
 
Cuando un proceso no est� bajo control que significa No est� haci.pdf
Cuando un proceso no est� bajo control que significa No est� haci.pdfCuando un proceso no est� bajo control que significa No est� haci.pdf
Cuando un proceso no est� bajo control que significa No est� haci.pdf
 
Cuando un proyectil (una roca del espacio, digamos) golpea la superf.pdf
Cuando un proyectil (una roca del espacio, digamos) golpea la superf.pdfCuando un proyectil (una roca del espacio, digamos) golpea la superf.pdf
Cuando un proyectil (una roca del espacio, digamos) golpea la superf.pdf
 
Cuando se trata de evaluaciones de desempe�o, los supervisores y los.pdf
Cuando se trata de evaluaciones de desempe�o, los supervisores y los.pdfCuando se trata de evaluaciones de desempe�o, los supervisores y los.pdf
Cuando se trata de evaluaciones de desempe�o, los supervisores y los.pdf
 
Cuando los lobos regresaron por primera vez a Yellowstone, las pobla.pdf
Cuando los lobos regresaron por primera vez a Yellowstone, las pobla.pdfCuando los lobos regresaron por primera vez a Yellowstone, las pobla.pdf
Cuando los lobos regresaron por primera vez a Yellowstone, las pobla.pdf
 
Cuando Joe maximiza la utilidad, encuentra que su MRS de X por Y (o .pdf
Cuando Joe maximiza la utilidad, encuentra que su MRS de X por Y (o .pdfCuando Joe maximiza la utilidad, encuentra que su MRS de X por Y (o .pdf
Cuando Joe maximiza la utilidad, encuentra que su MRS de X por Y (o .pdf
 
Cuando el suministro es de inter�s p�blico Roche y Tamiflu El caso .pdf
Cuando el suministro es de inter�s p�blico Roche y Tamiflu El caso .pdfCuando el suministro es de inter�s p�blico Roche y Tamiflu El caso .pdf
Cuando el suministro es de inter�s p�blico Roche y Tamiflu El caso .pdf
 
Cuando escuchas la palabra liderazgo, �qu� te viene a la mente Co.pdf
Cuando escuchas la palabra liderazgo, �qu� te viene a la mente Co.pdfCuando escuchas la palabra liderazgo, �qu� te viene a la mente Co.pdf
Cuando escuchas la palabra liderazgo, �qu� te viene a la mente Co.pdf
 
Cuando el fago lambda de tipo salvaje se sembra en placas en un c�sp.pdf
Cuando el fago lambda de tipo salvaje se sembra en placas en un c�sp.pdfCuando el fago lambda de tipo salvaje se sembra en placas en un c�sp.pdf
Cuando el fago lambda de tipo salvaje se sembra en placas en un c�sp.pdf
 
Cualquier ayuda es bienvenida. Jayne Butterfield, una madre solter.pdf
Cualquier ayuda es bienvenida. Jayne Butterfield, una madre solter.pdfCualquier ayuda es bienvenida. Jayne Butterfield, una madre solter.pdf
Cualquier ayuda es bienvenida. Jayne Butterfield, una madre solter.pdf
 
CS520 Computer Architecture Project 2 � Spring 2023 Due date 0326.pdf
CS520 Computer Architecture Project 2 � Spring 2023 Due date 0326.pdfCS520 Computer Architecture Project 2 � Spring 2023 Due date 0326.pdf
CS520 Computer Architecture Project 2 � Spring 2023 Due date 0326.pdf
 
Cross-cultural industrial and organizational psychology. Citation Tr.pdf
Cross-cultural industrial and organizational psychology. Citation Tr.pdfCross-cultural industrial and organizational psychology. Citation Tr.pdf
Cross-cultural industrial and organizational psychology. Citation Tr.pdf
 
Cryptography is designed to turn information into a format that is d.pdf
Cryptography is designed to turn information into a format that is d.pdfCryptography is designed to turn information into a format that is d.pdf
Cryptography is designed to turn information into a format that is d.pdf
 

Recently uploaded

Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 

Recently uploaded (20)

Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 

Creating the GUI was not an issue, I am having an issue creating the.pdf

  • 1. Creating the GUI was not an issue, I am having an issue creating the implementation. import javax.swing.*; import java.awt.event.*; import java.io.*; import java.util.*; public class Lab2 extends JFrame implements ActionListener { JButton open = new JButton("Next Program"); JTextArea result = new JTextArea(20,40); JLabel errors = new JLabel(); JScrollPane scroller = new JScrollPane(); public Lab2() { setLayout(new java.awt.FlowLayout()); setSize(500,430); setDefaultCloseOperation(DISPOSE_ON_CLOSE); add(open); open.addActionListener(this); scroller.getViewport().add(result); add(scroller); add(errors); } public void actionPerformed(ActionEvent evt) { result.setText(""); //clear TextArea for next program errors.setText(""); processProgram(); } public static void main(String[] args) { Lab2 display = new Lab2(); display.setVisible(true); } String getFileName() { JFileChooser fc = new JFileChooser(); int returnVal = fc.showOpenDialog(this);
  • 2. if (returnVal == JFileChooser.APPROVE_OPTION) return fc.getSelectedFile().getPath(); else return null; } /************************************************************************/ /* Put your implementation of the processProgram method here. */ /* Use the getFileName method to allow the user to select a program. */ /* Then simulate the execution of that program. */ /* You may add any other methods that you think are appropriate. */ /* However, you should not change anything in the code that I have */ /* written. */ /************************************************************************/ Write a Java program to read and simulate the execution of a program written in a highly simplified programming language. Each line in the input contains one statement. There are no declaration statements; all values are of type double. Statements in the language are in the following forms: Conditional Statement Meaning begin{tabular}{|l|l|} IF variable IS value THEN simpleStatement & Ifthevariableisequaltovalue(avariableoraconstant),thesimpleStatementisperformed. hline end{tabular} The GUI will include a "Next Program" button which allows the user to select a file containing a program to be executed. The program in the selected file is then executed and the output (result of the PRINT statements) should be displayed in a scrollable text area. NOTE Use of an array is NOT acceptable in this assignment.