使用Java在Linux中使用文本框显示通知

时间:2018-10-08 07:00:49

标签: java linux gtk gtk3 gnome-3

我想构建一个消息传递应用程序,当接收到带有文本框的消息时显示一个通知,以便使用Java在通知内进行回复

我是GTK库的noobie,我可以显示通知,但不知道如何使用文本框显示。

我已经在ubuntu中使用apt安装了libjava-gnome-java

这是我尝试显示通知的示例代码。

import org.gnome.gtk.Gtk;
import org.gnome.notify.Notification;
import org.gnome.notify.Notify;

public class Main {

public static void main(String[] args) {
    Gtk.init(args);

    Notify.init("My program name");

    Notification myNotification = new Notification("My notification title","My notification body","dialog-information");
    myNotification.show();
}
}

预先感谢

0 个答案:

没有答案