SlideShare a Scribd company logo
1 of 26
Interfaces
• Lists a set of methods and their signatures
– A class that ‘implements’ the interface must implement
all of the methods of the interface
– It is similar to a class, but there are differences:
• All methods in an interface type are abstract
They have a name, parameters, and a return type, but they
don’t have an implementation
• All methods in an interface type are automatically public
• An interface type cannot have instance variables
• An interface type cannot have static methods
Interface Syntax
• An interface declaration and a class that
implements the interface.
FileHelper Interface for the Classroom
Project
public interface FileHelper {
public boolean doesAFileExist();
public ArrayList<?> readFile();
public boolean writeFile(ArrayList<?> list);
}
Generics
• Code that uses generics has many benefits over non-
generic code:
– Elimination of casts. The following code snippet
without generics requires casting:
List list = new ArrayList();
list.add("hello");
String s = (String) list.get(0);
– When re-written to use generics, the code does not
require casting:
• List<String> list = new ArrayList<String>();
• list.add("hello");
• String s = list.get(0); // no cast
• Enables programmers to implement generic algorithms
– Implementing generic algorithms that work on
collections of different types, can be customized, and
are type safe and easier to read.
ClassroomFileHelper
public class ClassroomFileHelper implements FileHelper {
@Override
public boolean doesAFileExist(){
}
@Override
public ArrayList<?> readFile(){
}
@Override
public boolean writeFile(ArrayList<?> list){
}
}
InstructorFileHelper
public class InstructorFileHelper implements FileHelper {
@Override
public boolean doesAFileExist(){
}
@Override
public ArrayList<?> readFile(){
}
@Override
public boolean writeFile(ArrayList<?> list){
}
}
CourseFileHelper
public class CourseFileHelper implements FileHelper {
@Override
public boolean doesAFileExist(){
}
@Override
public ArrayList<?> readFile(){
}
@Override
public boolean writeFile(ArrayList<?> list){
}
}
Demo in Eclipse
• Implementing interfaces quickly
Moves
• heal( )
• attack( )
• jump( )
• defend( )
Good Guys
Bad Guys
implements
Items of notes
-return types
-parameters
-@Override
Java Swing
Frame Windows
 Java provides classes to create graphical applications
that can run on any major graphical user interface
 A graphical application shows information inside a
frame: a window with a title bar
 Java’s JFrame class allows you to display a frame
 It is part of the javax.swing package
Five steps to displaying a frame
1) Construct an object of the JFrame class in the main method
2) Set the size of the frame
3) Set the title of the frame
4) Set the “default close operation”
5) Make it visible
JFrame frame = new JFrame();
frame.setSize(300,400);
frame.setTitle(“An Empty Frame”);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible (true);
Adding Components to the JFrame
 You cannot draw directly on a JFrame object
 Instead, construct an object and add it to the frame
 A few examples objects to add are:
 JComponent
 JPanel
 JTextComponent
 Jlabel
 If you have more than one component, put them into a
panel (a container for other user-interface components),
and then add the panel to the frame
Create the Components
public class FormPanel extends JPanel{
JButton button = new JButton("Click me!");
JLabel label = new JLabel("Hello, World!");
public FormPanel( ) {
add(button);
add(label);
}
}
• Design a subclass of JFrame
• Store the components as
instance variables
• Initialize them in the
constructor of your subclass
Add the Panel to the Frame
public class StartProgram {
public static void main(String[ ] args) {
JFrame frame = new JFrame();
JPanel panel = new FormPanel();
frame.add(panel);
frame.setSize(250, 250);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
}
Project Notes
• Let Eclipse handle the imports
• Divide classes by function
– model
– view
– tests
– [controller]
• Always set the frame visible last
Your Book Favors…
private void createComponents() {
button = new JButton("Click me!");
label = new JLabel("Hello, World!");
JPanel panel = new JPanel();
panel.add(button);
panel.add(label);
add(panel);
}
Your Book Favors…
public class FilledFrame extends Jframe {
private JButton button;
private JLabel label;
private static final int FRAME_WIDTH = 300;
private static final int FRAME_HEIGHT = 100;
public FilledFrame()
{
createComponents();
setSize(FRAME_WIDTH, FRAME_HEIGHT);
}
}
Your Book Favors
public class FilledFrameViewer2 {
public static void main(String[] args)
{
JFrame frame = new FilledFrame();
frame.setTitle("A frame with two
components");
frame.setDefaultCloseOperation(JFrame.EXIT
_ON_CLOSE);
frame.setVisible(true);
}
}
Event Handling
 A program must indicate which events it wants to receive
 It does so by installing event listener objects
 An event listener object belongs to a class that you declare
 The methods of your event listener classes contain the
instructions that you want to have executed when the
events occur
 To install a listener, you need to know the event source
 You add an event listener object to selected event sources
 OK Button clicked, Cancel Button clicked, Menu Choice
 Whenever the event occurs, the event source calls the
appropriate methods of the attached event listeners
Implementation for Event Handling
• Create the class as an inner class inside the class
that contains the elements you want to listen
– Typically in your JPanel because your buttons are
created in it
• Implement the ActionListener interface
– Add the method
– Inside the method are the instructions to execute
once the action has been triggered
• Add the ActionListener to the Button
Inner Classes
 Inner classes are often used for ActionListeners
 An inner class is a class that is declared inside another class
 It may be declared inside or outside a method of the class
 Why inner classes? Two reasons:
1) It places the trivial listener class exactly where it is
needed, without cluttering up the remainder of the project
2) Their methods can access variables that are declared in
surrounding blocks
public class ButtonFrame2 extends JFrame
{
private JButton button;
private JLabel label;
. . .
class ClickListener implements ActionListener
{
public void actionPerformed(ActionEvent
event)
{
label.setText("I was clicked");
}
}
. . .
}
Can easily access methods of
the private instance of a label
object.
Outer
Block
Inner
Block
Class & Interface Implementation
public class ClearButtonListener implements ActionListener {
@Override
public void actionPerformed(ActionEvent e) {
// TODO Auto-generated method stub
dollarField.setText("");
euroField.setText("");
gbpField.setText("");
}
Attaching to Button
//inside the JPanel constructor
ClearButtonListener clearlistener = new ClearButtonListener( );
clearButton.addActionListener(clearlistener);
add(clearButton);
In a way, these are the ‘controllers’ for
our Swing interfaces. They are
contained in another class though.
Demo in Eclipse
StartProgram.java
Main Method
Creates the JFrame
Adds the JPanel to it
ConverterPanel
extends JPanel
All the components
All the clicklisteners
CurrencyConverter
Contains the business logic
Actually does the conversion
Demo in Eclipse
StartProgram.java
Main Method
Creates the JFrame
Adds the JPanel to it
ConverterPanel
extends JPanel
All the components
All the clicklisteners
model
package
view
packag
e
default
package
CurrencyConverter
Contains the business logic
Actually does the conversion

More Related Content

What's hot

What's hot (20)

Unit3 part1-class
Unit3 part1-classUnit3 part1-class
Unit3 part1-class
 
Static keyword ppt
Static keyword pptStatic keyword ppt
Static keyword ppt
 
Pi j3.2 polymorphism
Pi j3.2 polymorphismPi j3.2 polymorphism
Pi j3.2 polymorphism
 
Unit3 part3-packages and interfaces
Unit3 part3-packages and interfacesUnit3 part3-packages and interfaces
Unit3 part3-packages and interfaces
 
Lect 1-java object-classes
Lect 1-java object-classesLect 1-java object-classes
Lect 1-java object-classes
 
Classes and objects in java
Classes and objects in javaClasses and objects in java
Classes and objects in java
 
Object oriented programming in java
Object oriented programming in javaObject oriented programming in java
Object oriented programming in java
 
Classes&amp;objects
Classes&amp;objectsClasses&amp;objects
Classes&amp;objects
 
ITFT-Classes and object in java
ITFT-Classes and object in javaITFT-Classes and object in java
ITFT-Classes and object in java
 
Introduction to class in java
Introduction to class in javaIntroduction to class in java
Introduction to class in java
 
Unit3 part2-inheritance
Unit3 part2-inheritanceUnit3 part2-inheritance
Unit3 part2-inheritance
 
Lect 1-class and object
Lect 1-class and objectLect 1-class and object
Lect 1-class and object
 
Java: Objects and Object References
Java: Objects and Object ReferencesJava: Objects and Object References
Java: Objects and Object References
 
Unit 5 java-awt (1)
Unit 5 java-awt (1)Unit 5 java-awt (1)
Unit 5 java-awt (1)
 
Unit 4 exceptions and threads
Unit 4 exceptions and threadsUnit 4 exceptions and threads
Unit 4 exceptions and threads
 
Object Oriented Programming in PHP
Object Oriented Programming in PHPObject Oriented Programming in PHP
Object Oriented Programming in PHP
 
CLASS & OBJECT IN JAVA
CLASS & OBJECT  IN JAVACLASS & OBJECT  IN JAVA
CLASS & OBJECT IN JAVA
 
[OOP - Lec 19] Static Member Functions
[OOP - Lec 19] Static Member Functions[OOP - Lec 19] Static Member Functions
[OOP - Lec 19] Static Member Functions
 
Classes,object and methods java
Classes,object and methods javaClasses,object and methods java
Classes,object and methods java
 
6. static keyword
6. static keyword6. static keyword
6. static keyword
 

Similar to Logic and Coding of Java Interfaces & Swing Applications

Java tutorials
Java tutorialsJava tutorials
Java tutorials
saryu2011
 
Graphical User Interface (GUI) - 1
Graphical User Interface (GUI) - 1Graphical User Interface (GUI) - 1
Graphical User Interface (GUI) - 1
PRN USM
 
Chapter 2 JavaFX UI Controls and Multimedia.pptx
Chapter 2 JavaFX UI Controls and Multimedia.pptxChapter 2 JavaFX UI Controls and Multimedia.pptx
Chapter 2 JavaFX UI Controls and Multimedia.pptx
SamatarHussein
 
Understanding And Using Reflection
Understanding And Using ReflectionUnderstanding And Using Reflection
Understanding And Using Reflection
Ganesh Samarthyam
 

Similar to Logic and Coding of Java Interfaces & Swing Applications (20)

Gui
GuiGui
Gui
 
Lesson12 other behavioural patterns
Lesson12 other behavioural patternsLesson12 other behavioural patterns
Lesson12 other behavioural patterns
 
Interface
InterfaceInterface
Interface
 
Synapseindia reviews.odp.
Synapseindia reviews.odp.Synapseindia reviews.odp.
Synapseindia reviews.odp.
 
Chapter iv(modern gui)
Chapter iv(modern gui)Chapter iv(modern gui)
Chapter iv(modern gui)
 
Java Swing Handson Session (1).ppt
Java Swing Handson Session (1).pptJava Swing Handson Session (1).ppt
Java Swing Handson Session (1).ppt
 
Java For beginners and CSIT and IT students
Java  For beginners and CSIT and IT studentsJava  For beginners and CSIT and IT students
Java For beginners and CSIT and IT students
 
SWING.pptx
SWING.pptxSWING.pptx
SWING.pptx
 
Advance Java Programming (CM5I) 1.AWT
Advance Java Programming (CM5I) 1.AWTAdvance Java Programming (CM5I) 1.AWT
Advance Java Programming (CM5I) 1.AWT
 
L04 Software Design 2
L04 Software Design 2L04 Software Design 2
L04 Software Design 2
 
Java tutorials
Java tutorialsJava tutorials
Java tutorials
 
Graphical User Interface (GUI) - 1
Graphical User Interface (GUI) - 1Graphical User Interface (GUI) - 1
Graphical User Interface (GUI) - 1
 
Chapter 2 JavaFX UI Controls and Multimedia.pptx
Chapter 2 JavaFX UI Controls and Multimedia.pptxChapter 2 JavaFX UI Controls and Multimedia.pptx
Chapter 2 JavaFX UI Controls and Multimedia.pptx
 
Unit3 packages &amp; interfaces
Unit3 packages &amp; interfacesUnit3 packages &amp; interfaces
Unit3 packages &amp; interfaces
 
Closer look at classes
Closer look at classesCloser look at classes
Closer look at classes
 
#_ varible function
#_ varible function #_ varible function
#_ varible function
 
Design patterns
Design patternsDesign patterns
Design patterns
 
C# .NET: Language Features and Creating .NET Projects, Namespaces Classes and...
C# .NET: Language Features and Creating .NET Projects, Namespaces Classes and...C# .NET: Language Features and Creating .NET Projects, Namespaces Classes and...
C# .NET: Language Features and Creating .NET Projects, Namespaces Classes and...
 
Cse java
Cse javaCse java
Cse java
 
Understanding And Using Reflection
Understanding And Using ReflectionUnderstanding And Using Reflection
Understanding And Using Reflection
 

More from kjkleindorfer (8)

Week11 Inheritance class relationships in Java
Week11 Inheritance class relationships in JavaWeek11 Inheritance class relationships in Java
Week11 Inheritance class relationships in Java
 
Intro to Bootstrap
Intro to BootstrapIntro to Bootstrap
Intro to Bootstrap
 
Layouts Part 2
Layouts Part 2Layouts Part 2
Layouts Part 2
 
Layouts
Layouts Layouts
Layouts
 
Using PHP to submit forms
Using PHP to submit formsUsing PHP to submit forms
Using PHP to submit forms
 
Forms Part 1
Forms Part 1Forms Part 1
Forms Part 1
 
CSS Box Model
CSS Box ModelCSS Box Model
CSS Box Model
 
CSS Selectors and Fonts
CSS Selectors and FontsCSS Selectors and Fonts
CSS Selectors and Fonts
 

Recently uploaded

Recently uploaded (20)

Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
latest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answerslatest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answers
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Basic Intentional Injuries Health Education
Basic Intentional Injuries Health EducationBasic Intentional Injuries Health Education
Basic Intentional Injuries Health Education
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 

Logic and Coding of Java Interfaces & Swing Applications

  • 1. Interfaces • Lists a set of methods and their signatures – A class that ‘implements’ the interface must implement all of the methods of the interface – It is similar to a class, but there are differences: • All methods in an interface type are abstract They have a name, parameters, and a return type, but they don’t have an implementation • All methods in an interface type are automatically public • An interface type cannot have instance variables • An interface type cannot have static methods
  • 2. Interface Syntax • An interface declaration and a class that implements the interface.
  • 3. FileHelper Interface for the Classroom Project public interface FileHelper { public boolean doesAFileExist(); public ArrayList<?> readFile(); public boolean writeFile(ArrayList<?> list); }
  • 4. Generics • Code that uses generics has many benefits over non- generic code: – Elimination of casts. The following code snippet without generics requires casting: List list = new ArrayList(); list.add("hello"); String s = (String) list.get(0); – When re-written to use generics, the code does not require casting: • List<String> list = new ArrayList<String>(); • list.add("hello"); • String s = list.get(0); // no cast • Enables programmers to implement generic algorithms – Implementing generic algorithms that work on collections of different types, can be customized, and are type safe and easier to read.
  • 5. ClassroomFileHelper public class ClassroomFileHelper implements FileHelper { @Override public boolean doesAFileExist(){ } @Override public ArrayList<?> readFile(){ } @Override public boolean writeFile(ArrayList<?> list){ } }
  • 6. InstructorFileHelper public class InstructorFileHelper implements FileHelper { @Override public boolean doesAFileExist(){ } @Override public ArrayList<?> readFile(){ } @Override public boolean writeFile(ArrayList<?> list){ } }
  • 7. CourseFileHelper public class CourseFileHelper implements FileHelper { @Override public boolean doesAFileExist(){ } @Override public ArrayList<?> readFile(){ } @Override public boolean writeFile(ArrayList<?> list){ } }
  • 8. Demo in Eclipse • Implementing interfaces quickly Moves • heal( ) • attack( ) • jump( ) • defend( ) Good Guys Bad Guys implements Items of notes -return types -parameters -@Override
  • 10. Frame Windows  Java provides classes to create graphical applications that can run on any major graphical user interface  A graphical application shows information inside a frame: a window with a title bar  Java’s JFrame class allows you to display a frame  It is part of the javax.swing package
  • 11. Five steps to displaying a frame 1) Construct an object of the JFrame class in the main method 2) Set the size of the frame 3) Set the title of the frame 4) Set the “default close operation” 5) Make it visible JFrame frame = new JFrame(); frame.setSize(300,400); frame.setTitle(“An Empty Frame”); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible (true);
  • 12. Adding Components to the JFrame  You cannot draw directly on a JFrame object  Instead, construct an object and add it to the frame  A few examples objects to add are:  JComponent  JPanel  JTextComponent  Jlabel  If you have more than one component, put them into a panel (a container for other user-interface components), and then add the panel to the frame
  • 13. Create the Components public class FormPanel extends JPanel{ JButton button = new JButton("Click me!"); JLabel label = new JLabel("Hello, World!"); public FormPanel( ) { add(button); add(label); } } • Design a subclass of JFrame • Store the components as instance variables • Initialize them in the constructor of your subclass
  • 14. Add the Panel to the Frame public class StartProgram { public static void main(String[ ] args) { JFrame frame = new JFrame(); JPanel panel = new FormPanel(); frame.add(panel); frame.setSize(250, 250); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.setVisible(true); } }
  • 15. Project Notes • Let Eclipse handle the imports • Divide classes by function – model – view – tests – [controller] • Always set the frame visible last
  • 16. Your Book Favors… private void createComponents() { button = new JButton("Click me!"); label = new JLabel("Hello, World!"); JPanel panel = new JPanel(); panel.add(button); panel.add(label); add(panel); }
  • 17. Your Book Favors… public class FilledFrame extends Jframe { private JButton button; private JLabel label; private static final int FRAME_WIDTH = 300; private static final int FRAME_HEIGHT = 100; public FilledFrame() { createComponents(); setSize(FRAME_WIDTH, FRAME_HEIGHT); } }
  • 18. Your Book Favors public class FilledFrameViewer2 { public static void main(String[] args) { JFrame frame = new FilledFrame(); frame.setTitle("A frame with two components"); frame.setDefaultCloseOperation(JFrame.EXIT _ON_CLOSE); frame.setVisible(true); } }
  • 19. Event Handling  A program must indicate which events it wants to receive  It does so by installing event listener objects  An event listener object belongs to a class that you declare  The methods of your event listener classes contain the instructions that you want to have executed when the events occur  To install a listener, you need to know the event source  You add an event listener object to selected event sources  OK Button clicked, Cancel Button clicked, Menu Choice  Whenever the event occurs, the event source calls the appropriate methods of the attached event listeners
  • 20. Implementation for Event Handling • Create the class as an inner class inside the class that contains the elements you want to listen – Typically in your JPanel because your buttons are created in it • Implement the ActionListener interface – Add the method – Inside the method are the instructions to execute once the action has been triggered • Add the ActionListener to the Button
  • 21. Inner Classes  Inner classes are often used for ActionListeners  An inner class is a class that is declared inside another class  It may be declared inside or outside a method of the class  Why inner classes? Two reasons: 1) It places the trivial listener class exactly where it is needed, without cluttering up the remainder of the project 2) Their methods can access variables that are declared in surrounding blocks
  • 22. public class ButtonFrame2 extends JFrame { private JButton button; private JLabel label; . . . class ClickListener implements ActionListener { public void actionPerformed(ActionEvent event) { label.setText("I was clicked"); } } . . . } Can easily access methods of the private instance of a label object. Outer Block Inner Block
  • 23. Class & Interface Implementation public class ClearButtonListener implements ActionListener { @Override public void actionPerformed(ActionEvent e) { // TODO Auto-generated method stub dollarField.setText(""); euroField.setText(""); gbpField.setText(""); }
  • 24. Attaching to Button //inside the JPanel constructor ClearButtonListener clearlistener = new ClearButtonListener( ); clearButton.addActionListener(clearlistener); add(clearButton); In a way, these are the ‘controllers’ for our Swing interfaces. They are contained in another class though.
  • 25. Demo in Eclipse StartProgram.java Main Method Creates the JFrame Adds the JPanel to it ConverterPanel extends JPanel All the components All the clicklisteners CurrencyConverter Contains the business logic Actually does the conversion
  • 26. Demo in Eclipse StartProgram.java Main Method Creates the JFrame Adds the JPanel to it ConverterPanel extends JPanel All the components All the clicklisteners model package view packag e default package CurrencyConverter Contains the business logic Actually does the conversion