A modern, elegant Java application built with JavaFX featuring a beautiful user interface for task management. This application demonstrates modern UI/UX design principles with a clean, professional appearance.
- Modern UI Design: Clean, professional interface with gradient backgrounds and smooth animations
- Task Management: Create, edit, delete, and organize tasks with priority levels
- Responsive Layout: Adaptive design that works well on different screen sizes
- Beautiful Styling: Custom CSS with modern color schemes and typography
- Interactive Components: Rich UI components with hover effects and smooth transitions
- Data Visualization: Quick stats dashboard showing task overview
- Search & Filter: Built-in search functionality for task management
- Notifications: Toast notifications for user feedback
- Java 17 or higher - Download Java
- Maven 3.6+ - Download Maven
- Docker & Docker Compose - Download Docker
- Git (optional) - Download Git
-
Clone or Download the Project
git clone <repository-url> cd java-application
-
Verify Java Installation
java -version # Should show Java 17 or higher
-
Verify Maven Installation
mvn -version # Should show Maven 3.6 or higher
-
Verify Docker Installation
docker --version docker-compose --version
# Build and run with Docker Compose
docker-compose up --build
# Or run in detached mode
docker-compose up -d --build
# Stop the application
docker-compose down
# Build the Docker image
docker build -t modern-java-app .
# Run the container
docker run -it --rm \
-e DISPLAY=$DISPLAY \
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \
--privileged \
modern-java-app
# Navigate to project directory
cd /Users/mayurwagh/Documents/java-application
# Run the application
mvn clean javafx:run
# Compile the project
mvn clean compile
# Run the application
mvn exec:java -Dexec.mainClass="com.example.modernapp.MainApp"
- Open the project in your favorite IDE (IntelliJ IDEA, Eclipse, VS Code)
- Import as Maven project
- Run the
MainApp.java
class
- Enter a task title in the "Task Title" field
- Optionally add a description
- Select priority level (Low, Medium, High, Critical)
- Choose a due date
- Click "Add Task" or press Enter
- Edit: Click the edit button (pencil icon) in the Actions column
- Delete: Click the delete button (trash icon) in the Actions column
- Search: Use the search field to find specific tasks
- Filter: Use the filter button to organize tasks by criteria
The sidebar shows quick stats including:
- Total number of tasks
- Tasks in progress
- Completed tasks
java-application/
βββ pom.xml # Maven configuration
βββ README.md # This file
βββ src/
βββ main/
βββ java/
β βββ com/
β βββ example/
β βββ modernapp/
β βββ MainApp.java # Main application class
β βββ MainController.java # UI controller
βββ resources/
βββ com/
βββ example/
βββ modernapp/
βββ main-view.fxml # UI layout
βββ styles.css # Custom styling
- Color Scheme: Modern gradient backgrounds with professional color palette
- Typography: Clean, readable fonts with proper hierarchy
- Spacing: Consistent padding and margins for visual balance
- Shadows: Subtle drop shadows for depth and modern appearance
- Animations: Smooth hover effects and transitions
- Header: Gradient background with app title and user controls
- Sidebar: Task creation form and statistics dashboard
- Main Content: Task list with search and filter capabilities
- Table: Modern data table with action buttons
- Forms: Styled input fields with focus effects
- Buttons: Multiple button styles (primary, secondary, icon buttons)
- Java 17: Modern Java features and performance
- JavaFX 21: Rich client application framework
- Maven: Dependency management and build automation
- ControlsFX: Additional UI components
- Ikonli: FontAwesome icons for modern UI elements
- CSS3: Custom styling for modern appearance
Edit styles.css
to change the color scheme:
.header-box {
-fx-background-color: linear-gradient(to right, #your-color-1, #your-color-2);
}
- Extend the
MainController
class - Update the FXML layout in
main-view.fxml
- Add corresponding CSS styles in
styles.css
Replace FontAwesome icons in the controller:
editButton.setGraphic(new FontIcon(FontAwesomeSolid.YOUR_ICON));
- Multi-stage build for optimized image size
- Security hardening with non-root user
- Health checks for container monitoring
- X11 forwarding for GUI display
- Volume mounting for data persistence
Build the image:
docker build -t modern-java-app:latest .
Run with GUI support (Linux/macOS):
# Allow X11 forwarding
xhost +local:docker
# Run the container
docker run -it --rm \
-e DISPLAY=$DISPLAY \
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \
--privileged \
modern-java-app:latest
Run with Docker Compose:
# Start the application
docker-compose up --build
# View logs
docker-compose logs -f
# Stop the application
docker-compose down
For Windows users:
# Use VcXsrv or similar X11 server
docker run -it --rm \
-e DISPLAY=host.docker.internal:0.0 \
modern-java-app:latest
JAVA_OPTS
: JVM options (default:-Xmx512m -Xms256m
)DISPLAY
: X11 display serverQT_X11_NO_MITSHM
: Qt X11 configuration
Docker GUI Display Issues
# Linux/macOS: Allow X11 forwarding
xhost +local:docker
# Check if X11 is running
echo $DISPLAY
# Windows: Install VcXsrv or similar X11 server
JavaFX Runtime Not Found
# Add JavaFX modules to classpath
mvn clean compile exec:java -Dexec.mainClass="com.example.modernapp.MainApp" -Dexec.args="--module-path /path/to/javafx/lib --add-modules javafx.controls,javafx.fxml"
Maven Build Fails
# Clean and rebuild
mvn clean install
Application Won't Start
- Ensure Java 17+ is installed
- Check that all dependencies are resolved
- Verify Maven configuration
Docker Build Fails
# Clean Docker cache
docker system prune -a
# Rebuild without cache
docker build --no-cache -t modern-java-app .
Manifest Not Found Error If you get "manifest for maven:3.9.4-openjdk-17-slim not found", try these alternatives:
# Option 1: Use the simple Dockerfile
docker build -f Dockerfile.simple -t modern-java-app .
# Option 2: Use the alternative Dockerfile with Eclipse Temurin
docker build -f Dockerfile.alternative -t modern-java-app .
# Option 3: Use a different Maven image tag
# Edit Dockerfile and change the FROM line to:
# FROM maven:3.9-openjdk-17-slim AS build
- Check the JavaFX Documentation
- Review Maven Documentation
- Look at the ControlsFX Documentation
This project is open source and available under the MIT License.
Contributions are welcome! Please feel free to submit a Pull Request.
If you encounter any issues or have questions, please:
- Check the troubleshooting section above
- Review the code comments for implementation details
- Create an issue in the project repository
Enjoy your beautiful Java application! π