feat: java-gtk dependency
This commit is contained in:
parent
3480aee84d
commit
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>
|
15
pom.xml
15
pom.xml
@ -5,7 +5,7 @@
|
|||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<groupId>dev.ninjdai</groupId>
|
<groupId>dev.ninjdai</groupId>
|
||||||
<artifactId>stalgtk</artifactId>
|
<artifactId>prosopagtk</artifactId>
|
||||||
<version>1.0-SNAPSHOT</version>
|
<version>1.0-SNAPSHOT</version>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
@ -13,5 +13,18 @@
|
|||||||
<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>
|
||||||
|
<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>
|
||||||
|
|
||||||
</project>
|
</project>
|
@ -1,17 +1,37 @@
|
|||||||
package dev.ninjdai;
|
package dev.ninjdai;
|
||||||
|
|
||||||
//TIP To <b>Run</b> code, press <shortcut actionId="Run"/> or
|
import ch.bailu.gtk.gtk.Application;
|
||||||
// click the <icon src="AllIcons.Actions.Execute"/> icon in the gutter.
|
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 class Main {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
//TIP Press <shortcut actionId="ShowIntentionActions"/> with your caret at the highlighted text
|
var app = new Application("com.example.hello",
|
||||||
// to see how IntelliJ IDEA suggests fixing it.
|
ApplicationFlags.FLAGS_NONE);
|
||||||
System.out.printf("Hello and welcome!");
|
|
||||||
|
|
||||||
for (int i = 1; i <= 5; i++) {
|
app.onActivate(() -> {
|
||||||
//TIP Press <shortcut actionId="Debug"/> to start debugging your code. We have set one <icon src="AllIcons.Debugger.Db_set_breakpoint"/> breakpoint
|
// Create a new window
|
||||||
// for you, but you can always add more by pressing <shortcut actionId="ToggleLineBreakpoint"/>.
|
var window = new ApplicationWindow(app);
|
||||||
System.out.println("i = " + i);
|
|
||||||
}
|
// 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