How hoviethao/-calculator- works
Project type and purpose
• This is a standalone desktop application (“Calculator”) implemented in Java Swing.
• Its sole purpose is to provide a GUI for basic arithmetic operations and maintain a history file (lich_su_phep_tinh.txt).
File structure
• build.xml, manifest.mf, nbproject/… — Ant build script and NetBeans project configuration.
• src/thuchanh1/ — Java source package containing:
• Thuchanh1.java (core entry point or logic controller)
• giaodien.form and giaodien.java (Swing GUI form + generated code)
• test/ — Unit tests (Student.java, StudentTest.java) demonstrating a testing layer.
• lich_su_phep_tinh.txt — Persistent storage for calculation history.
README for additional insights
• Confirms a simple Java Swing calculator without any external services or server components.
a. Main components
• GUI Layer (Swing Form & JFrame code)
• Application Logic (Calculator engine / controller class)
• Persistence (history file)
• Build System (Ant)
• Testing Module
b. Relationships & interactions
• User events in GUI → invoke Application Logic methods
• Application Logic → reads/writes lich_su_phep_tinh.txt
• Build System pulls sources, compiles classes, packages JAR using manifest.mf
• Test Runner uses JUnit tests in test/ to validate logic
c. Architectural patterns & principles
• MVC‐lite: separation of View (giaodien), Controller/Model (Thuchanh1 logic)
• Single‐process, event‐driven Swing architecture
• Layered components: UI → Business Logic → Persistence
d. Key technologies
• Java SE 8+
• Swing (javax.swing) for GUI
• Ant for build automation
• JUnit (in test/) for unit testing
Diagramming conventions
• From “Swing GUI” → “Calculator Engine” (method calls)
• From “Calculator Engine” ↔ “History File” (read/write)
• From “Ant Build” → all source directories (compilation)
• From “JUnit Test Suite” → “Calculator Engine” (test dependency)
• UI in blue
• Logic in green
• Persistence in orange
• Build/Test tools in gray