Skip to content

About

Java Swing GUI simulating a post office: packages, letters, daily inventory, end-of-day recap table.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

post-office-java

A Java Swing GUI simulating a post office counter, built in the 2024-2025 academic year as a beginner Java programming project for Prof. Qiong Liu's course. Customers can send packages (priced by weight and destination) or letters, with input validation, inventory limits, and a daily recap table for the postman at end of day.

The GUI uses a BorderLayout split into five zones: a northern header, an eastern input panel, a central per-customer item list, a western daily recap, and a southern inventory tracker (inspired, genuinely, by the Sims). The pay button is disabled until at least one item is added; the end-of-day dialogue is modal so you can't just click past it.

Input validation handles missing fields, non-integer inputs, and out-of-range values (dimensions and weight must be between 1 and 100) via JOptionPane error dialogs. Inventory caps at 50 packages and 200 letters per day.

What I'd do differently

I drew a class diagram before starting and then didn't use it, convincing myself that a GUI didn't need separate classes. This was wrong. Everything ended up in one large PostOffice class with six inner ActionListener classes, which worked but became difficult to follow. If I did it again I'd build proper Customer, Letter, and Package classes from the start.

A note on the logo

The original version used the official La Poste logo, which — looking back on it — probably wasn't the the smartest idea ever. To publish the project here, I've replaced it with a kiwi I drew, still saved as laposte.png so the code runs without changes.

On Github use

I also clearly had no concept of gitignore when I initally added this to my Github... I've fixed that now.

To run

Open in your Java IDE of choice and run PostOffice.java.


Full write-up and presentation slides in the PDFs.

About

Java Swing GUI simulating a post office: packages, letters, daily inventory, end-of-day recap table.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages