java.awt.TrayIcon.displayMessage()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(236)

本文整理了Java中java.awt.TrayIcon.displayMessage()方法的一些代码示例,展示了TrayIcon.displayMessage()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TrayIcon.displayMessage()方法的具体详情如下:
包路径:java.awt.TrayIcon
类名称:TrayIcon
方法名:displayMessage

TrayIcon.displayMessage介绍

暂无

代码示例

代码示例来源:origin: runelite/runelite

private void sendTrayNotification(
  final String title,
  final String message,
  final TrayIcon.MessageType type)
{
  if (clientUI.getTrayIcon() != null)
  {
    clientUI.getTrayIcon().displayMessage(title, message, type);
  }
}

代码示例来源:origin: RipMeApp/ripme

mainFrame.toFront();
mainFrame.setAlwaysOnTop(true);
trayIcon.displayMessage(mainFrame.getTitle(), "Started ripping " + ripper.getURL().toExternalForm(), MessageType.INFO);
mainFrame.setAlwaysOnTop(false);

代码示例来源:origin: magefree/mage

public void displayMessage(String message) {
    if (trayIcon != null) {
      trayIcon.displayMessage("Mage", message, TrayIcon.MessageType.INFO);
    }
  }
}

代码示例来源:origin: stackoverflow.com

trayIcon.displayMessage("Some message.",
    "Some other message.",
    TrayIcon.MessageType.INFO);

代码示例来源:origin: tomighty/tomighty

private void showWelcomeMessage(TrayIcon icon) {
  String caption = messages.get("First time using Tomighty?");
  String message = messages.get("Click on the tomato icon to start using it");
  icon.displayMessage(caption, message, MessageType.INFO);
}

代码示例来源:origin: stackoverflow.com

public class Main {
 static Image image = Toolkit.getDefaultToolkit().getImage("images/tray.gif");

 static TrayIcon trayIcon = new TrayIcon(image, "Tester2");

 public static void main(String[] a) throws Exception {
  if (SystemTray.isSupported()) {
   SystemTray tray = SystemTray.getSystemTray();

   trayIcon.setImageAutoSize(true);
   trayIcon.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
     System.out.println("In here");
     trayIcon.displayMessage("Tester!", "Some action performed", TrayIcon.MessageType.INFO);
    }
   });

   try {
    tray.add(trayIcon);
   } catch (AWTException e) {
    System.err.println("TrayIcon could not be added.");
   }
  }
 }
}

代码示例来源:origin: stackoverflow.com

trayIcon.displayMessage("Good-bye", "Cruel World",
        TrayIcon.MessageType.WARNING);
timer = new javax.swing.Timer(125, updateCol());
timer.start();
trayIcon.displayMessage(null, "  Aplication Loaded  ", TrayIcon.MessageType.NONE);

代码示例来源:origin: IanDarwin/javasrc

public void actionPerformed(ActionEvent e) {
    System.out.println("Tray actionPerformed");
    trayIcon.displayMessage("Action Event",
        "An Action Event Has Been Performed!",
        TrayIcon.MessageType.INFO);
  }
};

代码示例来源:origin: martin-lizner/trezor-ssh-agent

public static void createWarning(String message) {
  if (trayIcon != null) {
    trayIcon.displayMessage(AgentConstants.APP_PUBLIC_NAME, message, TrayIcon.MessageType.WARNING);
  }
  Logger.getLogger(SSHAgent.class.getName()).log(Level.WARNING, message);
}

代码示例来源:origin: martin-lizner/trezor-ssh-agent

public static void createInfo(String message) {
  if (trayIcon != null) {
    trayIcon.displayMessage(AgentConstants.APP_PUBLIC_NAME, message, TrayIcon.MessageType.INFO);
  }
  Logger.getLogger(SSHAgent.class.getName()).log(Level.INFO, message);
}

代码示例来源:origin: stackoverflow.com

trayIcon.displayMessage(title, message, messageType);

代码示例来源:origin: chatty/chatty

/**
 * Displays a tray icon info message.
 * 
 * @param title The title to use
 * @param message The main message text to use
 */
public void displayInfo(String title, String message) {
  if (trayIcon != null) {
    addIcon();
    trayIcon.displayMessage(title, message, TrayIcon.MessageType.NONE);
  }
}

代码示例来源:origin: stackoverflow.com

SystemTray tray = SystemTray.getSystemTray();
Image image = Toolkit.getDefaultToolkit().getImage("tray.gif");
TrayIcon trayIcon = new TrayIcon(image, "Tray Demo");
tray.add(trayIcon);
trayIcon.displayMessage("Hello, World", "notification demo", MessageType.INFO);

代码示例来源:origin: rombert/desktop-maven-notifier

@Override
  public void run() {
    try {
      tray.add(icon);
      icon.displayMessage(title, details, getMessageType(notificationType));
      latch.countDown();
    } catch (AWTException e) {
      // don't care, no reporting channel
    }
  }
});

代码示例来源:origin: mucommander/mucommander

@Override
public boolean displayNotification(NotificationType notificationType, String title, String description) {
  LOGGER.debug("notificationType="+notificationType+" title="+title+" description="+description);
  if(!isEnabled()) {
    LOGGER.debug("Ignoring notification, this notifier is not enabled");
    return false;
  }
  trayIcon.displayMessage(title, description, MESSAGE_TYPES.get(notificationType));
  return true;
}

代码示例来源:origin: stackoverflow.com

final TrayIcon ti = new TrayIcon(XTPSkin.getInstance().getAppIcon().getImage());
final SystemTray st = SystemTray.getSystemTray();
st.add(ti);
ti.displayMessage("foo", "bar", MessageType.INFO);

代码示例来源:origin: martin-lizner/trezor-ssh-agent

public static void createError(String message, boolean addLogLinkMessage, Throwable ex) {
  String message2 = message;
  if (addLogLinkMessage) {
    message2 = message.concat("\n").concat(LocalizedLogger.getLocalizedMessage(AgentConstants.LINK_TO_LOG_KEY));
  }
  if (trayIcon != null) {
    trayIcon.displayMessage(AgentConstants.APP_PUBLIC_NAME, message2, TrayIcon.MessageType.ERROR);
  }
  Logger.getLogger(SSHAgent.class.getName()).log(Level.SEVERE, message, ex);
}

代码示例来源:origin: tonikelope/megabasterd

private String _genStatus() {
  int pre = _transference_preprocess_global_queue.size();
  int prov = _transference_provision_queue.size();
  int rem = _transference_remove_queue.size();
  int wait = getTransference_waitstart_queue().size();
  int run = _transference_running_list.size();
  int finish = _transference_finished_queue.size();
  if (!_tray_icon_finish && finish > 0 && pre + prov + wait + run == 0 && !_main_panel.getView().isVisible()) {
    _tray_icon_finish = true;
    _main_panel.getTrayicon().displayMessage("MegaBasterd says:", "All your transferences have finished", TrayIcon.MessageType.INFO);
  }
  return (pre + prov + rem + wait + run + finish > 0) ? "Pre: " + pre + " / Pro: " + prov + " / Wait: " + wait + " / Run: " + run + " / Finish: " + finish + " / Rem: " + rem : "";
}

代码示例来源:origin: jcgay/send-notification

@Override
public void send(Notification notification) {
  if (!skipNotifications) {
    icon.setImage(createImage(notification.icon().toByteArray()));
    icon.displayMessage(notification.title(), notification.message(), toMessageType(notification.level()));
  }
}

代码示例来源:origin: fr.jcgay.send-notification/send-notification

@Override
public void send(Notification notification) {
  if (!skipNotifications) {
    icon.setImage(createImage(notification.icon().toByteArray()));
    icon.displayMessage(notification.title(), notification.message(), toMessageType(notification.level()));
  }
}

相关文章