SlideShare a Scribd company logo
gUIsInterface/build.xml
Builds, tests, and runs the project gUIsInterface.
gUIsInterface/manifest.mf
Manifest-Version: 1.0
X-COMMENT: Main-Class will be added automatically by build
gUIsInterface/nbproject/build-impl.xml
gUIsInterfacebuild.xml      Builds, tests, and runs the pro.docx
gUIsInterfacebuild.xml      Builds, tests, and runs the pro.docx
gUIsInterfacebuild.xml      Builds, tests, and runs the pro.docx
gUIsInterfacebuild.xml      Builds, tests, and runs the pro.docx
gUIsInterfacebuild.xml      Builds, tests, and runs the pro.docx
Must set src.dir
Must set test.src.dir
Must set build.dir
Must set dist.dir
Must set build.classes.dir
Must set dist.javadoc.dir
Must set build.test.classes.dir
Must set build.test.results.dir
Must set build.classes.excludes
Must set dist.jar
gUIsInterfacebuild.xml      Builds, tests, and runs the pro.docx
gUIsInterfacebuild.xml      Builds, tests, and runs the pro.docx
Must set javac.includes
gUIsInterfacebuild.xml      Builds, tests, and runs the pro.docx
gUIsInterfacebuild.xml      Builds, tests, and runs the pro.docx
No tests executed.
gUIsInterfacebuild.xml      Builds, tests, and runs the pro.docx
gUIsInterfacebuild.xml      Builds, tests, and runs the pro.docx
gUIsInterfacebuild.xml      Builds, tests, and runs the pro.docx
gUIsInterfacebuild.xml      Builds, tests, and runs the pro.docx
gUIsInterfacebuild.xml      Builds, tests, and runs the pro.docx
gUIsInterfacebuild.xml      Builds, tests, and runs the pro.docx
Must set JVM to use for profiling in profiler.info.jvm
Must set profiler agent JVM arguments in
profiler.info.jvmargs.agent
gUIsInterfacebuild.xml      Builds, tests, and runs the pro.docx
gUIsInterfacebuild.xml      Builds, tests, and runs the pro.docx
gUIsInterfacebuild.xml      Builds, tests, and runs the pro.docx
gUIsInterfacebuild.xml      Builds, tests, and runs the pro.docx
gUIsInterfacebuild.xml      Builds, tests, and runs the pro.docx
Must select some files in the IDE or set javac.includes
gUIsInterfacebuild.xml      Builds, tests, and runs the pro.docx
To run this application from the command line without
Ant, try:
java -jar "${dist.jar.resolved}"
Must select one file in the IDE or set run.class
Must select one file in the IDE or set run.class
Must select one file in the IDE or set debug.class
Must select one file in the IDE or set debug.class
Must set fix.includes
This target only works when run from inside the NetBeans
IDE.
Must select one file in the IDE or set profile.class
This target only works when run from inside the NetBeans
IDE.
This target only works when run from inside the NetBeans
IDE.
This target only works when run from inside the NetBeans
IDE.
Must select one file in the IDE or set run.class
Must select some files in the IDE or set test.includes
Must select one file in the IDE or set run.class
Must select one file in the IDE or set applet.url
gUIsInterfacebuild.xml      Builds, tests, and runs the pro.docx
Must select some files in the IDE or set javac.includes
Some tests failed; see details above.
Must select some files in the IDE or set test.includes
Some tests failed; see details above.
Must select some files in the IDE or set test.class
Must select some method in the IDE or set test.method
Some tests failed; see details above.
Must select one file in the IDE or set test.class
Must select one file in the IDE or set test.class
Must select some method in the IDE or set test.method
Must select one file in the IDE or set applet.url
Must select one file in the IDE or set applet.url
gUIsInterface/nbproject/genfiles.properties
build.xml.data.CRC32=f0f4ed42
build.xml.script.CRC32=0ab153f7
[email protected]
# This file is used by a NetBeans-based IDE to track changes in
generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will
never regenerate such files for you.
nbproject/build-impl.xml.data.CRC32=f0f4ed42
nbproject/build-impl.xml.script.CRC32=54aa38f0
nbproject/[email protected]
gUIsInterface/nbproject/project.properties
annotation.processing.enabled=true
annotation.processing.enabled.in.editor=false
annotation.processing.processor.options=
annotation.processing.processors.list=
annotation.processing.run.all.processors=true
annotation.processing.source.output=${build.generated.sources.
dir}/ap-source-output
build.classes.dir=${build.dir}/classes
build.classes.excludes=**/*.java,**/*.form
# This directory is removed when the project is cleaned:
build.dir=build
build.generated.dir=${build.dir}/generated
build.generated.sources.dir=${build.dir}/generated-sources
# Only compile against the classpath explicitly listed here:
build.sysclasspath=ignore
build.test.classes.dir=${build.dir}/test/classes
build.test.results.dir=${build.dir}/test/results
# Uncomment to specify the preferred debugger connection
transport:
#debug.transport=dt_socket
debug.classpath=
${run.classpath}
debug.test.classpath=
${run.test.classpath}
# Files in build.classes.dir which should be excluded from
distribution jar
dist.archive.excludes=
# This directory is removed when the project is cleaned:
dist.dir=dist
dist.jar=${dist.dir}/gUIsInterface.jar
dist.javadoc.dir=${dist.dir}/javadoc
excludes=
includes=**
jar.compress=false
javac.classpath=
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
javac.external.vm=true
javac.processorpath=
${javac.classpath}
javac.source=1.8
javac.target=1.8
javac.test.classpath=
${javac.classpath}:
${build.classes.dir}
javac.test.processorpath=
${javac.test.classpath}
javadoc.additionalparam=
javadoc.author=false
javadoc.encoding=${source.encoding}
javadoc.noindex=false
javadoc.nonavbar=false
javadoc.notree=false
javadoc.private=false
javadoc.splitindex=true
javadoc.use=true
javadoc.version=false
javadoc.windowtitle=
main.class=guisinterface.GUIsInterface
manifest.file=manifest.mf
meta.inf.dir=${src.dir}/META-INF
mkdist.disabled=false
platform.active=default_platform
run.classpath=
${javac.classpath}:
${build.classes.dir}
# Space-separated list of JVM arguments used when running the
project.
# You may also define separate properties like run-sys-
prop.name=value instead of -Dname=value.
# To set system properties for unit tests define test-sys-
prop.name=value:
run.jvmargs=
run.test.classpath=
${javac.test.classpath}:
${build.test.classes.dir}
source.encoding=UTF-8
src.dir=src
test.src.dir=test
gUIsInterface/nbproject/project.xml
org.netbeans.modules.java.j2seproject
gUIsInterface
gUIsInterface/src/guisinterface/GUIsInterface.javagUIsInterface
/src/guisinterface/GUIsInterface.java/*
* To change this license header, choose License Headers in Pro
ject Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package guisinterface;
import java.awt.*;
import javax.swing.*;
publicclassGUIsInterface{
publicstaticvoid main(String[] args){
// create a frame to hold the components
JFrame myJFrame =newJFrame();
// crearte a Borderlayput and assign it to the JFrame
myJFrame.setLayout(newBorderLayout());
// create a panel for the number buttons
// Grid with 5 by 3
JPanel buttonsPanel =newJPanel(newGridLayout(5,3));
// Declare an array of 10 JButtons for digits 0-9
JButton[] numberButton =newJButton[10];
// define and add buttons to the first row: 1 2 3
// define and add buttons for 1-3 to the panel
for(int i =1; i<=3; i++)
{
numberButton[i]=newJButton(""+i);
buttonsPanel.add(numberButton[i]);
}
// define and add buttons to the second row: 4 5 6
// define and add buttons for 4-6 to the panel
for(int i =4; i<=6; i++)
{
numberButton[i]=newJButton(""+i);
buttonsPanel.add(numberButton[i]);
}
// define and add buttons to the third row: 7 8 9
// define and add buttons for 7-9 to the panel
for(int i =7; i<=9; i++)
{
numberButton[i]=newJButton(""+i);
buttonsPanel.add(numberButton[i]);
}
// define and add buttons to the fourth row: * 0 #
// add the * button
JButton asteriskButton =newJButton("*");
buttonsPanel.add(asteriskButton);
asteriskButton.setFont(newFont("Arial",Font.BOLD,12));
// add the zero button
numberButton[0]=newJButton("0");
buttonsPanel.add(numberButton[0]);
// add the # button
JButton hashButton =newJButton("#");
buttonsPanel.add(hashButton);
hashButton.setFont(newFont("Arial",Font.BOLD,12));
// define and add buttons to the fifth row: Call Blank DELETE
// add the CALL button
JButton callButton =newJButton("CALL");
buttonsPanel.add(callButton);
// apply ont and change font size
callButton.setFont(newFont("Arial",Font.BOLD +Font.IT
ALIC,12));
// set the frontvcolor for call button
callButton.setForeground(Color.GREEN);
// add the ADD button
JButton addButton =newJButton("ADD");
buttonsPanel.add(addButton);
// apply font and change font size
addButton.setFont(newFont("Arial",Font.BOLD +Font.ITA
LIC,12));
// set the front color for call button
addButton.setForeground(Color.BLUE);
// add the END button
JButton endButton =newJButton("END");
buttonsPanel.add(endButton);
// apply font and change font size
endButton.setFont(newFont("Arial",Font.BOLD +Font.ITA
LIC,12));
// set the front color for call button
endButton.setForeground(Color.RED);
// add the main button panel to the JFrame
myJFrame.add(buttonsPanel,BorderLayout.CENTER);
// Create a right justified textField to display the result
JTextField jtResult =newJTextField("Enter Phone Number");
jtResult.setHorizontalAlignment(JTextField.RIGHT);
// add the result text field to the JFrame
myJFrame.add(jtResult,BorderLayout.NORTH);
// set the title, size, location and exit behavior for the frame
myJFrame.setTitle("Telephone Interface Demo 1");
myJFrame.setSize(240,320);
myJFrame.setLocation(240,320);
myJFrame.setDefaultCloseOperation(JFrame.EXIT_ON_C
LOSE);
// make the frame visible
myJFrame.setVisible(true);
}// end main()
}// end class

More Related Content

DOCX
JobTestbuild.xml Builds, tests, and runs the project J.docx
DOCX
Question IYou are going to use the semaphores for process sy.docx
DOCX
Project3build.xml Builds, tests, and runs the project .docx
DOCX
stateDatabuild.xml Builds, tests, and runs the project.docx
DOCX
Generated by CamScanner from intsig.comR416build.xml.docx
ODP
ZopeSkel & Buildout packages
PPTX
Coded ui - lesson 4 - coded ui test
DOCX
Ordering System IP2buildclasses.netbeans_automatic_buildO.docx
JobTestbuild.xml Builds, tests, and runs the project J.docx
Question IYou are going to use the semaphores for process sy.docx
Project3build.xml Builds, tests, and runs the project .docx
stateDatabuild.xml Builds, tests, and runs the project.docx
Generated by CamScanner from intsig.comR416build.xml.docx
ZopeSkel & Buildout packages
Coded ui - lesson 4 - coded ui test
Ordering System IP2buildclasses.netbeans_automatic_buildO.docx

Similar to gUIsInterfacebuild.xml Builds, tests, and runs the pro.docx (20)

PDF
Angular Unit Testing NDC Minn 2018
DOCX
Morgagebuildclasses.netbeans_automatic_buildMorgagebui.docx
DOCX
HW_6-1build.xml Builds, tests, and runs the project HW.docx
DOCX
Total Compensationbuild.xml Builds, tests, and runs th.docx
PPT
N Unit Presentation
PPTX
Using prime[31] to connect your unity game to azure mobile services
DOC
Security lab
PDF
PresentationqwertyuiopasdfghUnittest.pdf
PDF
Python Testing 101 with Selenium
PDF
UPC Testing talk 2
PPTX
Autotools adaptation for integrating autotmatic unit tests and covering for K...
PPTX
Unit Testing Using N Unit
PDF
Plone testingdzug tagung2010
PDF
Tutorial ranorex
DOCX
Selenium my sql and junit user guide
PDF
Creating mass users using e_catt
DOCX
PT1420 Decision Structures in Pseudocode and Visual Basic .docx
DOCX
PRG 420 Week 3 Individual Assignment Netbeans Project (annual co.docx
PDF
Unit Testing in Flutter - From Workflow Essentials to Complex Scenarios
PPT
Eclipse Summit Europe '10 - Test UI Aspects of Plug-ins
Angular Unit Testing NDC Minn 2018
Morgagebuildclasses.netbeans_automatic_buildMorgagebui.docx
HW_6-1build.xml Builds, tests, and runs the project HW.docx
Total Compensationbuild.xml Builds, tests, and runs th.docx
N Unit Presentation
Using prime[31] to connect your unity game to azure mobile services
Security lab
PresentationqwertyuiopasdfghUnittest.pdf
Python Testing 101 with Selenium
UPC Testing talk 2
Autotools adaptation for integrating autotmatic unit tests and covering for K...
Unit Testing Using N Unit
Plone testingdzug tagung2010
Tutorial ranorex
Selenium my sql and junit user guide
Creating mass users using e_catt
PT1420 Decision Structures in Pseudocode and Visual Basic .docx
PRG 420 Week 3 Individual Assignment Netbeans Project (annual co.docx
Unit Testing in Flutter - From Workflow Essentials to Complex Scenarios
Eclipse Summit Europe '10 - Test UI Aspects of Plug-ins

More from whittemorelucilla (20)

DOCX
Database reports provide us with the ability to further analyze ou.docx
DOCX
DataInformationKnowledge1.  Discuss the relationship between.docx
DOCX
DataHole 12 Score6757555455555455575775655565656555655656556566643.docx
DOCX
DataDestination PalletsTotal CasesCases redCases whiteCases organi.docx
DOCX
DataIllinois Tool WorksConsolidated Statement of Income($ in milli.docx
DOCX
DataIDSalaryCompa-ratioMidpoint AgePerformance RatingServiceGender.docx
DOCX
DataCity1997 Median Price1997 Change1998 Forecast1993-98 Annualize.docx
DOCX
DataClientRoom QualityFood QualityService Quality1GPG2GGG3GGG4GPG5.docx
DOCX
Database Project CharterBusiness CaseKhalia HartUnive.docx
DOCX
Databases selected Multiple databases...Full Text (1223 .docx
DOCX
Database SystemsDesign, Implementation, and ManagementCo.docx
DOCX
DATABASE SYSTEMS DEVELOPMENT & IMPLEMENTATION PLAN1DATABASE SYS.docx
DOCX
Database Security Assessment Transcript You are a contracting office.docx
DOCX
DOCX
Database Design Mid Term ExamSpring 2020Name ________________.docx
DOCX
Database Justification MemoCreate a 1-page memo for the .docx
DOCX
Database Concept Maphttpwikieducator.orgCCNCCCN.docx
DOCX
Database Dump Script(Details of project in file)Mac1) O.docx
DOCX
Database Design 1. What is a data model A. method of sto.docx
DOCX
DataAGEGENDERETHNICMAJORSEMHOUSEGPAHRSNEWSPAPTVHRSSLEEPWEIGHTHEIGH.docx
Database reports provide us with the ability to further analyze ou.docx
DataInformationKnowledge1.  Discuss the relationship between.docx
DataHole 12 Score6757555455555455575775655565656555655656556566643.docx
DataDestination PalletsTotal CasesCases redCases whiteCases organi.docx
DataIllinois Tool WorksConsolidated Statement of Income($ in milli.docx
DataIDSalaryCompa-ratioMidpoint AgePerformance RatingServiceGender.docx
DataCity1997 Median Price1997 Change1998 Forecast1993-98 Annualize.docx
DataClientRoom QualityFood QualityService Quality1GPG2GGG3GGG4GPG5.docx
Database Project CharterBusiness CaseKhalia HartUnive.docx
Databases selected Multiple databases...Full Text (1223 .docx
Database SystemsDesign, Implementation, and ManagementCo.docx
DATABASE SYSTEMS DEVELOPMENT & IMPLEMENTATION PLAN1DATABASE SYS.docx
Database Security Assessment Transcript You are a contracting office.docx
Database Design Mid Term ExamSpring 2020Name ________________.docx
Database Justification MemoCreate a 1-page memo for the .docx
Database Concept Maphttpwikieducator.orgCCNCCCN.docx
Database Dump Script(Details of project in file)Mac1) O.docx
Database Design 1. What is a data model A. method of sto.docx
DataAGEGENDERETHNICMAJORSEMHOUSEGPAHRSNEWSPAPTVHRSSLEEPWEIGHTHEIGH.docx

Recently uploaded (20)

PPTX
Pharma ospi slides which help in ospi learning
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
Classroom Observation Tools for Teachers
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PDF
Complications of Minimal Access Surgery at WLH
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PPTX
Cell Types and Its function , kingdom of life
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
Presentation on HIE in infants and its manifestations
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Pharma ospi slides which help in ospi learning
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
2.FourierTransform-ShortQuestionswithAnswers.pdf
O7-L3 Supply Chain Operations - ICLT Program
Microbial disease of the cardiovascular and lymphatic systems
Classroom Observation Tools for Teachers
202450812 BayCHI UCSC-SV 20250812 v17.pptx
Complications of Minimal Access Surgery at WLH
Microbial diseases, their pathogenesis and prophylaxis
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
Final Presentation General Medicine 03-08-2024.pptx
human mycosis Human fungal infections are called human mycosis..pptx
Cell Types and Its function , kingdom of life
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
Anesthesia in Laparoscopic Surgery in India
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Chinmaya Tiranga quiz Grand Finale.pdf
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
Presentation on HIE in infants and its manifestations
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx

gUIsInterfacebuild.xml Builds, tests, and runs the pro.docx

  • 1. gUIsInterface/build.xml Builds, tests, and runs the project gUIsInterface. gUIsInterface/manifest.mf Manifest-Version: 1.0 X-COMMENT: Main-Class will be added automatically by build gUIsInterface/nbproject/build-impl.xml
  • 7. Must set src.dir Must set test.src.dir Must set build.dir Must set dist.dir Must set build.classes.dir Must set dist.javadoc.dir Must set build.test.classes.dir Must set build.test.results.dir Must set build.classes.excludes Must set dist.jar
  • 20. Must set JVM to use for profiling in profiler.info.jvm Must set profiler agent JVM arguments in profiler.info.jvmargs.agent
  • 26. Must select some files in the IDE or set javac.includes
  • 28. To run this application from the command line without Ant, try: java -jar "${dist.jar.resolved}"
  • 29. Must select one file in the IDE or set run.class Must select one file in the IDE or set run.class
  • 30. Must select one file in the IDE or set debug.class Must select one file in the IDE or set debug.class Must set fix.includes This target only works when run from inside the NetBeans IDE.
  • 31. Must select one file in the IDE or set profile.class This target only works when run from inside the NetBeans IDE. This target only works when run from inside the NetBeans IDE. This target only works when run from inside the NetBeans IDE.
  • 32. Must select one file in the IDE or set run.class Must select some files in the IDE or set test.includes
  • 33. Must select one file in the IDE or set run.class Must select one file in the IDE or set applet.url
  • 35. Must select some files in the IDE or set javac.includes Some tests failed; see details above.
  • 36. Must select some files in the IDE or set test.includes Some tests failed; see details above. Must select some files in the IDE or set test.class Must select some method in the IDE or set test.method Some tests failed; see details above. Must select one file in the IDE or set test.class Must select one file in the IDE or set test.class Must select some method in the IDE or set test.method
  • 37. Must select one file in the IDE or set applet.url Must select one file in the IDE or set applet.url
  • 38. gUIsInterface/nbproject/genfiles.properties build.xml.data.CRC32=f0f4ed42 build.xml.script.CRC32=0ab153f7 [email protected] # This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
  • 39. # Do not edit this file. You may delete it but then the IDE will never regenerate such files for you. nbproject/build-impl.xml.data.CRC32=f0f4ed42 nbproject/build-impl.xml.script.CRC32=54aa38f0 nbproject/[email protected] gUIsInterface/nbproject/project.properties annotation.processing.enabled=true annotation.processing.enabled.in.editor=false annotation.processing.processor.options= annotation.processing.processors.list= annotation.processing.run.all.processors=true annotation.processing.source.output=${build.generated.sources. dir}/ap-source-output build.classes.dir=${build.dir}/classes build.classes.excludes=**/*.java,**/*.form # This directory is removed when the project is cleaned: build.dir=build build.generated.dir=${build.dir}/generated build.generated.sources.dir=${build.dir}/generated-sources # Only compile against the classpath explicitly listed here: build.sysclasspath=ignore build.test.classes.dir=${build.dir}/test/classes build.test.results.dir=${build.dir}/test/results # Uncomment to specify the preferred debugger connection transport: #debug.transport=dt_socket debug.classpath= ${run.classpath} debug.test.classpath= ${run.test.classpath} # Files in build.classes.dir which should be excluded from distribution jar dist.archive.excludes= # This directory is removed when the project is cleaned: dist.dir=dist
  • 40. dist.jar=${dist.dir}/gUIsInterface.jar dist.javadoc.dir=${dist.dir}/javadoc excludes= includes=** jar.compress=false javac.classpath= # Space-separated list of extra javac options javac.compilerargs= javac.deprecation=false javac.external.vm=true javac.processorpath= ${javac.classpath} javac.source=1.8 javac.target=1.8 javac.test.classpath= ${javac.classpath}: ${build.classes.dir} javac.test.processorpath= ${javac.test.classpath} javadoc.additionalparam= javadoc.author=false javadoc.encoding=${source.encoding} javadoc.noindex=false javadoc.nonavbar=false javadoc.notree=false javadoc.private=false javadoc.splitindex=true javadoc.use=true javadoc.version=false javadoc.windowtitle= main.class=guisinterface.GUIsInterface manifest.file=manifest.mf meta.inf.dir=${src.dir}/META-INF mkdist.disabled=false platform.active=default_platform run.classpath=
  • 41. ${javac.classpath}: ${build.classes.dir} # Space-separated list of JVM arguments used when running the project. # You may also define separate properties like run-sys- prop.name=value instead of -Dname=value. # To set system properties for unit tests define test-sys- prop.name=value: run.jvmargs= run.test.classpath= ${javac.test.classpath}: ${build.test.classes.dir} source.encoding=UTF-8 src.dir=src test.src.dir=test gUIsInterface/nbproject/project.xml org.netbeans.modules.java.j2seproject gUIsInterface gUIsInterface/src/guisinterface/GUIsInterface.javagUIsInterface /src/guisinterface/GUIsInterface.java/* * To change this license header, choose License Headers in Pro
  • 42. ject Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package guisinterface; import java.awt.*; import javax.swing.*; publicclassGUIsInterface{ publicstaticvoid main(String[] args){ // create a frame to hold the components JFrame myJFrame =newJFrame(); // crearte a Borderlayput and assign it to the JFrame myJFrame.setLayout(newBorderLayout()); // create a panel for the number buttons // Grid with 5 by 3 JPanel buttonsPanel =newJPanel(newGridLayout(5,3)); // Declare an array of 10 JButtons for digits 0-9 JButton[] numberButton =newJButton[10]; // define and add buttons to the first row: 1 2 3 // define and add buttons for 1-3 to the panel for(int i =1; i<=3; i++) { numberButton[i]=newJButton(""+i); buttonsPanel.add(numberButton[i]); } // define and add buttons to the second row: 4 5 6 // define and add buttons for 4-6 to the panel for(int i =4; i<=6; i++)
  • 43. { numberButton[i]=newJButton(""+i); buttonsPanel.add(numberButton[i]); } // define and add buttons to the third row: 7 8 9 // define and add buttons for 7-9 to the panel for(int i =7; i<=9; i++) { numberButton[i]=newJButton(""+i); buttonsPanel.add(numberButton[i]); } // define and add buttons to the fourth row: * 0 # // add the * button JButton asteriskButton =newJButton("*"); buttonsPanel.add(asteriskButton); asteriskButton.setFont(newFont("Arial",Font.BOLD,12)); // add the zero button numberButton[0]=newJButton("0"); buttonsPanel.add(numberButton[0]); // add the # button JButton hashButton =newJButton("#"); buttonsPanel.add(hashButton); hashButton.setFont(newFont("Arial",Font.BOLD,12)); // define and add buttons to the fifth row: Call Blank DELETE // add the CALL button JButton callButton =newJButton("CALL"); buttonsPanel.add(callButton); // apply ont and change font size callButton.setFont(newFont("Arial",Font.BOLD +Font.IT ALIC,12)); // set the frontvcolor for call button
  • 44. callButton.setForeground(Color.GREEN); // add the ADD button JButton addButton =newJButton("ADD"); buttonsPanel.add(addButton); // apply font and change font size addButton.setFont(newFont("Arial",Font.BOLD +Font.ITA LIC,12)); // set the front color for call button addButton.setForeground(Color.BLUE); // add the END button JButton endButton =newJButton("END"); buttonsPanel.add(endButton); // apply font and change font size endButton.setFont(newFont("Arial",Font.BOLD +Font.ITA LIC,12)); // set the front color for call button endButton.setForeground(Color.RED); // add the main button panel to the JFrame myJFrame.add(buttonsPanel,BorderLayout.CENTER); // Create a right justified textField to display the result JTextField jtResult =newJTextField("Enter Phone Number"); jtResult.setHorizontalAlignment(JTextField.RIGHT); // add the result text field to the JFrame myJFrame.add(jtResult,BorderLayout.NORTH); // set the title, size, location and exit behavior for the frame myJFrame.setTitle("Telephone Interface Demo 1"); myJFrame.setSize(240,320); myJFrame.setLocation(240,320); myJFrame.setDefaultCloseOperation(JFrame.EXIT_ON_C LOSE);
  • 45. // make the frame visible myJFrame.setVisible(true); }// end main() }// end class