Java Practice

Java Gravity Simulation

A Java gravity sandbox with Swing rendering, vector classes, trails, camera controls, hover/follow state, and a small JavaFX 3D experiment.

Java
Physics
Simulation
Live: Local Java runCode: Local Java source

Employer signal

What This Project Shows

This project shows object-oriented simulation work without relying on p5.js. The math, rendering loop, object model, and controls are all explicit Java code.

Problem

What Needed To Be Solved

A physics sandbox becomes hard to extend if the math, object state, rendering, and input handling are tangled together.

Approach

How I Built The Solution

I separated vector operations, gravity objects, system force updates, and the simulation panel. That gave the project reusable pieces for calculating forces, drawing trails, handling mouse/keyboard input, and experimenting with 3D.

Outcome

What It Demonstrates

The project is a useful Java counterpart to the p5 gravity sketch and shows the same modeling idea implemented with lower-level application structure.

Evidence From Source

Source signal

The project includes `Vector2`, `GravityObject`, `GravitySystemHandler`, `GravitySim`, and `Solar3D` classes under the local Java source tree.

Architecture signal

The system handler computes net forces across objects, while individual objects own position, velocity, acceleration, and trail drawing.