Click here to Skip to main content
15,559,974 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi I am using this code to make a notification in java. But it is showing
JAVA TM PLATFORM BINARY
How can I remove it.

Java
SystemTray tray = SystemTray.getSystemTray();

        TrayIcon trayIcon = new TrayIcon(Toolkit.getDefaultToolkit().getImage(""),"TEST");
        
        tray.add(trayIcon);
        trayIcon.displayMessage("TITLE", "Text", TrayIcon.MessageType.NONE);

Image:
https://ibb.co/hgn9RB6[^]

What I have tried:

SEARCHING GOOGLE BUT COULDN'T FIND NOTHING HELPFUL.
Posted
Updated 15-Jul-21 5:46am
v4
Comments
Richard MacCutchan 15-Jul-21 10:23am    
What is showing that message and where?
Mr.Corona 15-Jul-21 10:26am    
I have edited the question see it to see the img.
Mr.Corona 15-Jul-21 10:33am    
I have edited the question see it to see the imgage.
Richard MacCutchan 15-Jul-21 11:04am    
The display is correct. The title of the message box is generated by Windows, so you know where it comes from.
Mr.Corona 15-Jul-21 22:11pm    
So can I change that?

1 solution

If you are having trouble with some code then make use of the documentation or tutorials:
How to Use the System Tray (The Java™ Tutorials > Creating a GUI With JFC/Swing > Using Other Swing Features)[^]
 
Share this answer
 
Comments
Mr.Corona 15-Jul-21 11:15am    
not working sir
Richard MacCutchan 15-Jul-21 11:17am    
What is that supposed to mean?
Mr.Corona 15-Jul-21 21:57pm    
Sir in that link there is no example of creating a notification. When I searched google and found a solution it showed the notification but the problem is it is showing java tm platform binary.. . When i converted my program to an executable using Launch4j, then also it is showing java tm ..... How can I remove that?
Richard MacCutchan 16-Jul-21 3:13am    
The link I gave you contains a link the the demo code that provides a full example of the use of the TrayIcon class; that is why I posted it here. And I know it is correct as I downloaded the sample myself and tested it.

As to your question, I already told you that the title on the notification box is put there by the Windows system so you cannot remove it.
Mr.Corona 17-Jul-21 2:44am    
But this https://stackoverflow.com/a/47851505/16436946

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900