A Java AWT/Swing desktop application for creating, visualizing, and manipulating two-dimensional integer arrays with comprehensive statistical analysis and matrix operations.
- Array Generation: Create random 2D arrays with custom dimensions and value ranges
- Visual Display: Interactive grid rendering with automatic resize support
- Statistical Analysis: Calculate min, max, average, and standard deviation
- Search Operations: Find values and display their coordinates
- Matrix Mathematics: Add, subtract, and multiply arrays
- Menu-Driven Interface: Intuitive menu system for all operations
- Real-Time Updates: Automatic repainting on window resize
# Build the project
mvn clean package
# Run the application
java -jar target/array-2d-operations-1.0.0.jar# Compile
javac Array2DOperations.java TwoDArray.java
# Run
java Array2DOperations- About: Display feature summary and application info
- Create New Array: Configure rows, columns, and value range to generate random array
- Minimum: Find and display smallest value
- Maximum: Find and display largest value
- Average: Calculate mean value
- Standard Deviation: Compute statistical deviation
- Array Search: Find specific value and show its location
- Array Add: Add two arrays element-wise
- Array Subtract: Subtract second array from first
- Array Multiply: Perform matrix multiplication (requires compatible dimensions)
- Arrays must have same dimensions
- Element-wise operations
- Requires compatible sizes:
A[m × k] × B[k × n] = C[m × n] - Standard matrix multiplication algorithm
- Array2DOperations.java: Main window, menu system, event handling, rendering
- TwoDArray.java: Core logic for array operations, statistics, and matrix math
- Dialog-based input using
JOptionPane - Custom rendering with Java Graphics API
- Event-driven architecture
- Thread-safe operations
- JDK 21 (Temurin recommended)
- Maven 3.9+
- Cross-platform: Windows, macOS, Linux
# Clone the repository
git clone https://github.com/maxwell-hauser/java_array_2d_operations.git
cd java_array_2d_operations
# Build with Maven
mvn clean install
# Run tests
mvn test- Dimensions: Choose array sizes that fit comfortably in your window
- Value Range: Select appropriate min/max values for better visualization
- Matrix Multiplication: Ensure middle dimensions match (k in A[m×k] and B[k×n])
- Resize: Window automatically redraws arrays when resized
- Enhanced input validation with retry loops
- Export arrays and results to CSV
- Color-coded cells based on value magnitude
- Search result highlighting in grid
- Keyboard shortcuts for frequent operations
- Additional statistical measures (median, mode)
This project is licensed under the MIT License - see the LICENSE file for details.
Maxwell Hauser
Contributions, issues, and feature requests are welcome! Feel free to check the issues page.