Compare commits
2 Commits
3480aee84d
...
55a3db11a6
Author | SHA1 | Date | |
---|---|---|---|
55a3db11a6 | |||
d7c7b577ee |
7
.idea/encodings.xml
generated
Normal file
7
.idea/encodings.xml
generated
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="Encoding">
|
||||||
|
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
|
||||||
|
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
|
||||||
|
</component>
|
||||||
|
</project>
|
56
pom.xml
56
pom.xml
@ -4,8 +4,8 @@
|
|||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
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>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<groupId>dev.ninjdai</groupId>
|
<groupId>dev.ninjdai.prosopagtk</groupId>
|
||||||
<artifactId>stalgtk</artifactId>
|
<artifactId>prosopagtk</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
@ -13,5 +13,53 @@
|
|||||||
<maven.compiler.target>21</maven.compiler.target>
|
<maven.compiler.target>21</maven.compiler.target>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
</properties>
|
</properties>
|
||||||
|
<repositories>
|
||||||
</project>
|
<repository>
|
||||||
|
<id>jitpack.io</id>
|
||||||
|
<url>https://jitpack.io</url>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.bailuk</groupId>
|
||||||
|
<artifactId>java-gtk</artifactId>
|
||||||
|
<version>v0.5.0</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-shade-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>shade</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<createDependencyReducedPom>false</createDependencyReducedPom>
|
||||||
|
<transformers>
|
||||||
|
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
|
||||||
|
<mainClass>dev.ninjdai.prosopagtk.Main</mainClass>
|
||||||
|
</transformer>
|
||||||
|
</transformers>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<archive>
|
||||||
|
<manifest>
|
||||||
|
<addClasspath>true</addClasspath>
|
||||||
|
<mainClass>dev.ninjdai.prosopagtk.Main</mainClass>
|
||||||
|
</manifest>
|
||||||
|
</archive>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</project>
|
||||||
|
@ -1,17 +0,0 @@
|
|||||||
package dev.ninjdai;
|
|
||||||
|
|
||||||
//TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or
|
|
||||||
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter.
|
|
||||||
public class Main {
|
|
||||||
public static void main(String[] args) {
|
|
||||||
//TIP Press <shortcut actionId="ShowIntentionActions"/> with your caret at the highlighted text
|
|
||||||
// to see how IntelliJ IDEA suggests fixing it.
|
|
||||||
System.out.printf("Hello and welcome!");
|
|
||||||
|
|
||||||
for (int i = 1; i <= 5; i++) {
|
|
||||||
//TIP Press <shortcut actionId="Debug"/> to start debugging your code. We have set one <icon src="AllIcons.Debugger.Db_set_breakpoint"/> breakpoint
|
|
||||||
// for you, but you can always add more by pressing <shortcut actionId="ToggleLineBreakpoint"/>.
|
|
||||||
System.out.println("i = " + i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
37
src/main/java/dev/ninjdai/prosopagtk/Main.java
Normal file
37
src/main/java/dev/ninjdai/prosopagtk/Main.java
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
package dev.ninjdai.prosopagtk;
|
||||||
|
|
||||||
|
import ch.bailu.gtk.gtk.Application;
|
||||||
|
import ch.bailu.gtk.gtk.ApplicationWindow;
|
||||||
|
import ch.bailu.gtk.gio.ApplicationFlags;
|
||||||
|
import ch.bailu.gtk.gtk.Button;
|
||||||
|
import ch.bailu.gtk.type.Strs;
|
||||||
|
|
||||||
|
public class Main {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
var app = new Application("com.example.hello",
|
||||||
|
ApplicationFlags.FLAGS_NONE);
|
||||||
|
|
||||||
|
app.onActivate(() -> {
|
||||||
|
// Create a new window
|
||||||
|
var window = new ApplicationWindow(app);
|
||||||
|
|
||||||
|
// Create a new button
|
||||||
|
var button = new Button();
|
||||||
|
|
||||||
|
// Set button label
|
||||||
|
button.setLabel("Hello, World!");
|
||||||
|
|
||||||
|
// When the button is clicked, close the window
|
||||||
|
button.onClicked(window::close);
|
||||||
|
|
||||||
|
window.setChild(button);
|
||||||
|
window.show();
|
||||||
|
});
|
||||||
|
|
||||||
|
// Start application main loop
|
||||||
|
var result = app.run(args.length, new Strs(args));
|
||||||
|
|
||||||
|
// Terminate with exit code
|
||||||
|
System.exit(result);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user