Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/efrain-svg/Potes_Freddy_ProgInterfacesG_U3/llms.txt

Use this file to discover all available pages before exploring further.

Contact Management App is a Java Swing desktop application that organizes personal and professional contacts, providing CRUD operations, CSV import/export, multilingual support, and live statistics charts. The entire codebase follows a classic Model-View-Controller structure, enforced through Java package boundaries and a strict separation of concerns: the model never references Swing, the view never holds business logic, and the controller owns all event wiring and concurrency.

Package structure

The source tree under src/ maps one-to-one with the three MVC layers plus a set of view-support utilities.
PackageFilesRole
modelopersona.java, personaDAO.javaEntity and data-access layer
vistaventana.javaMain application window (view)
controladorlogica_ventana.javaEvent handling and business logic (controller)
vista.themeThemeManager.java, SvgIconLoader.javaLook-and-feel setup and icon loading
vista.i18nI18n.javaInternationalization / ResourceBundle wrapper
vista.chartsBarChartPanel.java, PieChartPanel.javaCustom painted statistics panels
src
modelo
persona.java
personaDAO.java
vista
ventana.java
theme
ThemeManager.java
SvgIconLoader.java
i18n
I18n.java
charts
BarChartPanel.java
PieChartPanel.java
controlador
logica_ventana.java

Module interaction

The following table traces the primary runtime interactions between modules:
FromToInteraction
ventana (view)ThemeManagerCalls setupLookAndFeel() before the window is created
ventana (view)logica_ventanaInstantiates the controller and passes this as the delegate
logica_ventana (controller)ventanaReads public fields to wire listeners and update UI state
logica_ventana (controller)personaDAOCalls load, save, update, and export methods
logica_ventana (controller)I18nFetches translated strings for all UI labels
personaDAO (data access)personaReads datosContacto() to serialize; constructs instances when loading
ventana (view)BarChartPanel / PieChartPanelEmbeds chart panels in the Statistics tab
ventana (view)SvgIconLoaderLoads SVG icons for toolbar buttons

Technology stack

Java 17

Core runtime. Uses java.time.LocalDate, java.util.concurrent locks and executors, and java.util.ResourceBundle for i18n.

Java Swing

UI toolkit. JFrame, JTable with TableRowSorter, JTabbedPane, GridBagLayout, BorderLayout, and InputMap/ActionMap for keyboard shortcuts.

FlatLaf 3.6

Third-party Swing look-and-feel that replaces the default Metal/Nimbus theme with a modern flat UI. Applied once at startup via ThemeManager.

SwingWorker

Built-in concurrency bridge. Used for all disk I/O (loading, searching, duplicate checking) to keep the Event Dispatch Thread responsive.

ExecutorService

java.util.concurrent.ExecutorService with dedicated thread pools for CSV export (2 threads) and UI notifications (1 thread).

CSV flat-file storage

No database dependency. Contacts are persisted as semicolon-delimited CSV at c:/gestionContactos/datosContactos.csv with RFC 4180 escaping.

Key design decisions

Java’s built-in themes (Metal, Nimbus) look dated on modern operating systems. FlatLaf provides a flat, cross-platform UI that renders consistently on Windows, macOS, and Linux without requiring platform-specific LAF detection. It is applied once, before any Swing component is created, in ThemeManager.setupLookAndFeel().
Swing is single-threaded: all component updates must happen on the Event Dispatch Thread (EDT). Reading or writing a CSV file on the EDT freezes the UI until the operation completes. SwingWorker moves blocking work to a background thread and then marshals results back to the EDT in done() / process(), keeping the application responsive even with large contact lists.
The application targets Spanish, English, and Portuguese speakers. Centralizing all display strings in I18n (backed by ResourceBundle) means every label, button, and error message can be switched at runtime by calling aplicarIdioma(String) in the controller—no UI rebuild required. It also makes adding new locales a matter of providing a new properties file rather than touching source code.
The controller manages three separate locks—contactosLock, exportLock, and editLock—because different operations compete over different shared resources. ReentrantLock provides explicit, named locking that makes the concurrency model visible in the code and allows lock-interruptible waits, which is useful for the export executor where a long-running export should not block an unrelated edit.
ventana.java exposes all interactive Swing components as public fields. This is a deliberate trade-off: in a tightly scoped desktop application where the view and controller are always compiled together, public field access eliminates the boilerplate of dozens of trivial getters while keeping all event-wiring logic in one place (logica_ventana.configurarEventos()). The view remains a pure UI assembly class with no business logic.
A flat CSV file has zero deployment overhead—no database server, no connection pool, no migration scripts. For a single-user desktop contact manager the data volume is low and a semicolon-delimited file is human-readable and directly importable into spreadsheet tools. The DAO layer (personaDAO) encapsulates all file access so the storage format can be changed without touching the model or controller.

MVC pattern implementation

How each MVC layer is defined, how the view exposes components, and how the controller wires events.

Contact data model

The persona entity fields, constructors, CSV serialization, and personaDAO method reference.

Build docs developers (and LLMs) love