Skip to content

prod3v3loper/java-desktop-website-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

JAVA DESKTOP APPLICATION

APP

A simple application that allows you to log in via the database and get to the dashboard. The data can be accessed from your website database but also from elsewhere.

Download it and open it with NetBeans, then just click Run and it will open. You can develop it further and add whatever your application needs.

LoginApp/
β”œβ”€β”€ nbproject/
β”‚   β”œβ”€β”€ private/
β”‚   β”œβ”€β”€ ...
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ main/
β”‚   β”‚   β”œβ”€β”€ java/
β”‚   β”‚   β”‚   └── com/
β”‚   β”‚   β”‚       └── prod3v3loper/
β”‚   β”‚   β”‚           └── loginapp/
β”‚   β”‚   β”‚               β”œβ”€β”€ LoginForm.java
β”‚   β”‚   β”‚               β”œβ”€β”€ DashboardFrame.java
β”‚   β”‚   β”‚               └── DatabaseConnection.java
β”‚   β”‚   β”œβ”€β”€ resources/
β”‚   β”‚       β”œβ”€β”€ images/
β”‚   β”‚       β”‚   └── p3.png
β”‚   β”‚       └── application.properties
β”œβ”€β”€ target/
β”‚   β”œβ”€β”€ ...
β”œβ”€β”€ .gitignore
β”œβ”€β”€ pom.xml
└── README.md

DATABASE

Change your database, if you already have a local environment (developer environment) then you can directly use localhost and work and develop with it.

private static final String URL = "jdbc:mysql://localhost:6606/databasename";
private static final String USER = "root";
private static final String PASSWORD = "test";

JAR to EXE

Use https://launch4j.sourceforge.net/ to create exe file.

Alternative

This project was created with https://netbeans.apache.org/.

But you can use https://start.spring.io/ to create your startup project if you want.

Attention

This one should not use in a real environment but unfortunately there is also something in real environments.

UPDATE

Migrating Spring Boot and Kotlin example.

pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.prod3v3loper</groupId>
    <artifactId>LoginApp</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <properties>
        <java.version>11</java.version>
        <kotlin.version>1.5.21</kotlin.version>
        <spring-boot.version>2.5.4</spring-boot.version>
    </properties>

    <dependencies>
        <!-- Spring Boot Dependencies -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <scope>runtime</scope>
        </dependency>

        <!-- Kotlin Dependencies -->
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-stdlib</artifactId>
        </dependency>
        <dependency>
            <groupId>org.jetbrains.kotlin</groupId>
            <artifactId>kotlin-reflect</artifactId>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.module</groupId>
            <artifactId>jackson-module-kotlin</artifactId>
        </dependency>

        <!-- Spring Boot Test Dependencies -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.jetbrains.kotlin</groupId>
                <artifactId>kotlin-maven-plugin</artifactId>
                <version>${kotlin.version}</version>
                <executions>
                    <execution>
                        <id>compile</id>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>test-compile</id>
                        <goals>
                            <goal>test-compile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>
</project>

src/main/kotlin/Application.kt

package com.prod3v3loper.loginapp

import org.springframework.boot.autoconfigure.SpringBootApplication
import org.springframework.boot.runApplication

@SpringBootApplication
class Application

fun main(args: Array<String>) {
    runApplication<Application>(*args)
}

src/main/resources/application.properties

spring.datasource.url=jdbc:mysql://localhost:6606/databasename
spring.datasource.username=root
spring.datasource.password=password
spring.jpa.hibernate.ddl-auto=update

src/main/kotlin/com/prod3v3loper/loginapp/HelloController.kt

package com.prod3v3loper.loginapp

import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.RestController

@RestController
class HelloController {

    @GetMapping("/")
    fun hello(): String {
        return "Hello, Spring Boot with Kotlin!"
    }
}

ISSUE

Please use the issue tab to request a:

  • Bug
  • Feature

Choose template and report a bug or feature you want issues.

CONTRIBUTE

Please read the contributing to contribute.

VULNERABILITY

Please use the Security section for privately reporting a vulnerability.

Authors

prod3v3loper - All works

License

MIT