-1

Well I need to show text messages directly on the screen.

I tried searching a lot but found nothing that could solve my problem.

The options I found on the interner:

  • To use a JFrame and render text on that.
  • To print text on a console.

But the problems with these here I do not want any window to pop up.

I also want the text to be on top of all.

My attempt:

As far as my tries here it is :

enter image description here

Here is what it should look like:

enter image description here

As you can see my try is far from what I want.

Well is there a better way? Is it possible Without any Frames?

Well this could be similar to Toast messages in Android.

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
Jaysmito Mukherjee
  • 1,467
  • 2
  • 10
  • 29
  • I dont think there is a good alternative for JFrame but what could be interesting for you is this: https://docs.oracle.com/javase/tutorial/uiswing/components/rootpane.html –  Feb 01 '21 at 06:32
  • @scolastico actually i want this to show (1) Very urgent messages (2) In some cases live subtitles of any audio . And mostly the app will run as a background process thus i want to avoid JFrame – Jaysmito Mukherjee Feb 01 '21 at 06:37
  • If i understand correctly what you want you could simply run the iframe in a extra thread. And for the always on top problem you can see the solution here: https://stackoverflow.com/a/14796014/10536157 –  Feb 01 '21 at 06:41
  • If you're using Java, you're limited to [JavaFX and JFC Swing](https://docs.oracle.com/javase/8/javase-clienttechnologies.htm). You can create a background process that puts up a JFrame for 60 seconds, then disposes of it. – Gilbert Le Blanc Feb 01 '21 at 06:43
  • @GilbertLeBlanc can you suggest a better option in any other language as for this part i could migrate – Jaysmito Mukherjee Feb 01 '21 at 06:46
  • @scolastico yup but for the translucent effect i tried to use setOpacity function but the problem is that it makes everything transparent but i want the text to be normal – Jaysmito Mukherjee Feb 01 '21 at 06:48
  • My guess would be C#. Here's the documentation from Microsoft: [Create and register an in-process background task](https://learn.microsoft.com/en-us/windows/uwp/launch-resume/create-and-register-an-inproc-background-task). – Gilbert Le Blanc Feb 01 '21 at 06:49

1 Answers1

0

I did achieve what I intended.

Here is the link to the GitHub Repository : https://github.com/Jaysmitio101/jsubs

This is a Java Library for showing subtitles on any screen and also show messages like Toast messages in android.

Jaysmito Mukherjee
  • 1,467
  • 2
  • 10
  • 29