Skip to content

mayurmwagh/java-application

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Modern Java Application with Beautiful Frontend

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.

🎨 Features

  • 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

πŸš€ Quick Start

Prerequisites

Installation & Setup

  1. Clone or Download the Project

    git clone <repository-url>
    cd java-application
  2. Verify Java Installation

    java -version
    # Should show Java 17 or higher
  3. Verify Maven Installation

    mvn -version
    # Should show Maven 3.6 or higher
  4. Verify Docker Installation

    docker --version
    docker-compose --version

Running the Application

Option 1: Using Docker (Recommended for Production)

# 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

Option 2: Using Docker directly

# 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

Option 3: Using Maven (Local Development)

# Navigate to project directory
cd /Users/mayurwagh/Documents/java-application

# Run the application
mvn clean javafx:run

Option 4: Compile and Run Manually

# Compile the project
mvn clean compile

# Run the application
mvn exec:java -Dexec.mainClass="com.example.modernapp.MainApp"

Option 5: Using IDE

  1. Open the project in your favorite IDE (IntelliJ IDEA, Eclipse, VS Code)
  2. Import as Maven project
  3. Run the MainApp.java class

🎯 How to Use

Adding Tasks

  1. Enter a task title in the "Task Title" field
  2. Optionally add a description
  3. Select priority level (Low, Medium, High, Critical)
  4. Choose a due date
  5. Click "Add Task" or press Enter

Managing Tasks

  • 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

Viewing Statistics

The sidebar shows quick stats including:

  • Total number of tasks
  • Tasks in progress
  • Completed tasks

πŸ—οΈ Project Structure

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

🎨 UI Components

Design Elements

  • 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

Key UI Features

  • 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)

πŸ› οΈ Technology Stack

  • 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

πŸ”§ Customization

Modifying Colors

Edit styles.css to change the color scheme:

.header-box {
    -fx-background-color: linear-gradient(to right, #your-color-1, #your-color-2);
}

Adding New Features

  1. Extend the MainController class
  2. Update the FXML layout in main-view.fxml
  3. Add corresponding CSS styles in styles.css

Changing Icons

Replace FontAwesome icons in the controller:

editButton.setGraphic(new FontIcon(FontAwesomeSolid.YOUR_ICON));

🐳 Docker Deployment

Docker Features

  • 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

Docker Commands

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

Docker Environment Variables

  • JAVA_OPTS: JVM options (default: -Xmx512m -Xms256m)
  • DISPLAY: X11 display server
  • QT_X11_NO_MITSHM: Qt X11 configuration

πŸ› Troubleshooting

Common Issues

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

Getting Help

πŸ“ License

This project is open source and available under the MIT License.

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

πŸ“ž Support

If you encounter any issues or have questions, please:

  1. Check the troubleshooting section above
  2. Review the code comments for implementation details
  3. Create an issue in the project repository

Enjoy your beautiful Java application! πŸŽ‰

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published