Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #31403 > unrolled thread

how to write this simple program?

Started byJohn <xsli2@yahoo.com>
First post2015-03-29 13:11 -0700
Last post2015-03-29 20:26 -0400
Articles 8 — 4 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  how to write this simple program? John <xsli2@yahoo.com> - 2015-03-29 13:11 -0700
    Re: how to write this simple program? Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-03-29 16:35 -0400
      Re: how to write this simple program? Jeff Higgins <jeff@invalid.invalid> - 2015-03-29 20:27 -0400
        Re: how to write this simple program? John <xsli2@yahoo.com> - 2015-03-29 18:23 -0700
          Re: how to write this simple program? Jeff Higgins <jeff@invalid.invalid> - 2015-03-29 22:50 -0400
          Re: how to write this simple program? Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-03-30 08:13 -0400
          Re: how to write this simple program? Lew <lewbloch@gmail.com> - 2015-04-04 10:02 -0700
    Re: how to write this simple program? Jeff Higgins <jeff@invalid.invalid> - 2015-03-29 20:26 -0400

#31403 — how to write this simple program?

FromJohn <xsli2@yahoo.com>
Date2015-03-29 13:11 -0700
Subjecthow to write this simple program?
Message-ID<7466d6e0-1e5d-422e-abdc-9798818b6ad9@googlegroups.com>
Hi:

I want to write a simple program: when it is running, it flashes a sentence on the computer screen for 300 milliseconds(300 can be adjusted), then disappear. After 10 seconds(also can be adjusted), it flashes again. It keeps doing this, until the user pause or exit the program.

There is no any frames to be shown. Only a few words are shown on the desktop screen quickly, then disappear. I don't want to see a rectangle surrounding the words. If the user is using a program, like browsing the internet, the words are still shown on the top of the application he is using.

Not sure Java GUI can do this. If not, what other programming language can do it? C programming language? It's intended to be used on Microsoft Windows.

Thank you very much.

[toc] | [next] | [standalone]


#31404

FromEric Sosman <esosman@comcast-dot-net.invalid>
Date2015-03-29 16:35 -0400
Message-ID<mf9nl2$b83$1@dont-email.me>
In reply to#31403
On 3/29/2015 4:11 PM, John wrote:
> Hi:
>
> I want to write a simple program: when it is running, it flashes a sentence on the computer screen for 300 milliseconds(300 can be adjusted), then disappear. After 10 seconds(also can be adjusted), it flashes again. It keeps doing this, until the user pause or exit the program.
>
> There is no any frames to be shown. Only a few words are shown on the desktop screen quickly, then disappear. I don't want to see a rectangle surrounding the words. If the user is using a program, like browsing the internet, the words are still shown on the top of the application he is using.
>
> Not sure Java GUI can do this. If not, what other programming language can do it? C programming language? It's intended to be used on Microsoft Windows.

     Java can do it, pretty much.  Build a JFrame containing what you
want to display, and before displaying it use setUndecorated(true) and
probably setAlwaysOnTop(true).  Then use a javax.swing.Timer object to
make the JFrame visible/invisible at scheduled moments (you could do it
with a java.util.Timer, too, but the Swing timer is probably simpler).

     The "pretty much" part is that the method I've described will also
put an icon in the taskbar (if there's a way to avoid this, I don't know
it), so your "only a few words" requirement is not satisfied perfectly.
On the other hand, you imply that the user should be able to "pause or
exit the program," which suggests he needs *some* way to communicate
with it; a taskbar icon might be just what's needed.

-- 
esosman@comcast-dot-net.invalid
"Don't be afraid of work. Make work afraid of you." -- TLM

[toc] | [prev] | [next] | [standalone]


#31406

FromJeff Higgins <jeff@invalid.invalid>
Date2015-03-29 20:27 -0400
Message-ID<mfa5be$u05$2@dont-email.me>
In reply to#31404
On 03/29/2015 04:35 PM, Eric Sosman wrote:
> On 3/29/2015 4:11 PM, John wrote:
>> Hi:
>>
>> I want to write a simple program: when it is running, it flashes a
>> sentence on the computer screen for 300 milliseconds(300 can be
>> adjusted), then disappear. After 10 seconds(also can be adjusted), it
>> flashes again. It keeps doing this, until the user pause or exit the
>> program.
>>
>> There is no any frames to be shown. Only a few words are shown on the
>> desktop screen quickly, then disappear. I don't want to see a
>> rectangle surrounding the words. If the user is using a program, like
>> browsing the internet, the words are still shown on the top of the
>> application he is using.
>>
>> Not sure Java GUI can do this. If not, what other programming language
>> can do it? C programming language? It's intended to be used on
>> Microsoft Windows.
>
>      Java can do it, pretty much.  Build a JFrame containing what you
> want to display, and before displaying it use setUndecorated(true) and
> probably setAlwaysOnTop(true).  Then use a javax.swing.Timer object to
> make the JFrame visible/invisible at scheduled moments (you could do it
> with a java.util.Timer, too, but the Swing timer is probably simpler).
>
>      The "pretty much" part is that the method I've described will also
> put an icon in the taskbar (if there's a way to avoid this, I don't know
> it), so your "only a few words" requirement is not satisfied perfectly.
> On the other hand, you imply that the user should be able to "pause or
> exit the program," which suggests he needs *some* way to communicate
> with it; a taskbar icon might be just what's needed.
>
<http://stackoverflow.com/questions/24564136/javafx-can-you-create-a-stage-that-doesnt-show-on-the-task-bar-and-is-undecora>

[toc] | [prev] | [next] | [standalone]


#31407

FromJohn <xsli2@yahoo.com>
Date2015-03-29 18:23 -0700
Message-ID<e4b328a8-27ba-4dfc-b61a-ce0a63f1dae6@googlegroups.com>
In reply to#31406
Thank you all for the help.

Actually, it is totally fine if there is an icon shown in the right bottom system tray there. Users need that to pause, quit, or configure how long the words shown on the screen and the interval etc.

"opaque background", you mean the rectangle containing the words will block what users are viewing, for 300 milliseconds? (If coded in Java)It cannot be set to transparent? 
Anyway, I am not sure this matters. It is only 300 milliseconds. 

"Windows API", first time heard that. Just checked on youtube for ten minutes, no clue about it.

[toc] | [prev] | [next] | [standalone]


#31408

FromJeff Higgins <jeff@invalid.invalid>
Date2015-03-29 22:50 -0400
Message-ID<mfadni$hos$1@dont-email.me>
In reply to#31407
On 03/29/2015 09:23 PM, John wrote:

> "Windows API", first time heard that. Just checked on youtube for ten minutes, no clue about it.
Thanks for that!
<https://www.youtube.com/watch?v=nH18SA03gfU>

[toc] | [prev] | [next] | [standalone]


#31410

FromEric Sosman <esosman@comcast-dot-net.invalid>
Date2015-03-30 08:13 -0400
Message-ID<mfbejc$9i7$1@dont-email.me>
In reply to#31407
On 3/29/2015 9:23 PM, John wrote:
>
> "opaque background", you mean the rectangle containing the words will block what users are viewing, for 300 milliseconds? (If coded in Java)It cannot be set to transparent?

     Sorry; forgot to mention this.  You can try the setOpacity() method,
although different platforms handle it differently (and some may not
support it at all).  Give it a whirl, see if it helps.

-- 
esosman@comcast-dot-net.invalid
"Don't be afraid of work. Make work afraid of you." -- TLM

[toc] | [prev] | [next] | [standalone]


#31455

FromLew <lewbloch@gmail.com>
Date2015-04-04 10:02 -0700
Message-ID<8a3fc6a6-47e0-46dd-acfb-34ec92ca3459@googlegroups.com>
In reply to#31407
Why YouTube and not lmgtfy.com? 

[toc] | [prev] | [next] | [standalone]


#31405

FromJeff Higgins <jeff@invalid.invalid>
Date2015-03-29 20:26 -0400
Message-ID<mfa58m$u05$1@dont-email.me>
In reply to#31403
On 03/29/2015 04:11 PM, John wrote:
> Hi:
>
> I want to write a simple program: when it is running, it flashes a sentence on the computer screen for 300 milliseconds(300 can be adjusted), then disappear. After 10 seconds(also can be adjusted), it flashes again. It keeps doing this, until the user pause or exit the program.
>
> There is no any frames to be shown. Only a few words are shown on the desktop screen quickly, then disappear. I don't want to see a rectangle surrounding the words. If the user is using a program, like browsing the internet, the words are still shown on the top of the application he is using.

Only if your platform supports compositing,
otherwise you'll see an opaque background.

> Not sure Java GUI can do this. If not, what other programming language can do it? C programming language? It's intended to be used on Microsoft Windows.

Not so much a language issue as a library issue.
If you intend to target only windows then
Windows API would be the most direct route,
and the most likely to way to achieve your goal.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web