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


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

Messagebox on current desktop

Started byCecil Westerhof <Cecil@decebal.nl>
First post2015-01-06 23:38 +0100
Last post2015-01-11 18:17 +0100
Articles 15 — 5 participants

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


Contents

  Messagebox on current desktop Cecil Westerhof <Cecil@decebal.nl> - 2015-01-06 23:38 +0100
    Re: Messagebox on current desktop Eric Sosman <esosman@comcast-dot-net.invalid> - 2015-01-06 18:13 -0500
      Re: Messagebox on current desktop Knute Johnson <eternal@knutejohnson.com> - 2015-01-06 16:04 -0800
    Re: Messagebox on current desktop Jeff Higgins <jeff@invalid.invalid> - 2015-01-07 07:14 -0500
      Re: Messagebox on current desktop Jeff Higgins <jeff@invalid.invalid> - 2015-01-07 07:19 -0500
      Re: Messagebox on current desktop Jeff Higgins <jeff@invalid.invalid> - 2015-01-07 07:39 -0500
        Re: Messagebox on current desktop Jeff Higgins <jeff@invalid.invalid> - 2015-01-07 08:44 -0500
        Re: Messagebox on current desktop Jeff Higgins <jeff@invalid.invalid> - 2015-01-07 10:17 -0500
          Re: Messagebox on current desktop Jeff Higgins <jeff@invalid.invalid> - 2015-01-07 10:37 -0500
      Re: Messagebox on current desktop Jeff Higgins <jeff@invalid.invalid> - 2015-01-07 09:11 -0500
        Re: Messagebox on current desktop Jeff Higgins <jeff@invalid.invalid> - 2015-01-07 09:41 -0500
        Re: Messagebox on current desktop Jeff Higgins <jeff@invalid.invalid> - 2015-01-07 09:46 -0500
          Re: Messagebox on current desktop Jeff Higgins <jeff@invalid.invalid> - 2015-01-07 09:49 -0500
    Re: Messagebox on current desktop Arne Vajhøj <arne@vajhoej.dk> - 2015-01-10 23:04 -0500
      Re: Messagebox on current desktop Cecil Westerhof <Cecil@decebal.nl> - 2015-01-11 18:17 +0100

#30639 — Messagebox on current desktop

FromCecil Westerhof <Cecil@decebal.nl>
Date2015-01-06 23:38 +0100
SubjectMessagebox on current desktop
Message-ID<87387n7cw4.fsf@Equus.decebal.nl>
You can get a Messagebox with:
        JOptionPane.showMessageDialog(this,
                                      "Message",
                                      "Title",
                                      JOptionPane.INFORMATION_MESSAGE,
                                      null);

The problem is that I work with Linux and have several desktops. The
messagebox is displayed on the desktop where the program is running.
Is there a method to get the messagebox on the current desktop?

For example the program is running on desktop 3. I am working on
desktop 1. Instead of the messagebox displayed on desktop 3 (where I
will not see it), I want it displayed on desktop 1.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

[toc] | [next] | [standalone]


#30640

FromEric Sosman <esosman@comcast-dot-net.invalid>
Date2015-01-06 18:13 -0500
Message-ID<m8hq69$naf$1@dont-email.me>
In reply to#30639
On 1/6/2015 5:38 PM, Cecil Westerhof wrote:
> You can get a Messagebox with:
>          JOptionPane.showMessageDialog(this,
>                                        "Message",
>                                        "Title",
>                                        JOptionPane.INFORMATION_MESSAGE,
>                                        null);
>
> The problem is that I work with Linux and have several desktops. The
> messagebox is displayed on the desktop where the program is running.
> Is there a method to get the messagebox on the current desktop?

     I don't know, but I'd be willing to bet that the first
argument will have to be something other than "this".  See
if you can find some likely alternatives to try in that spot.

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

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


#30642

FromKnute Johnson <eternal@knutejohnson.com>
Date2015-01-06 16:04 -0800
Message-ID<m8ht5a$1io$1@dont-email.me>
In reply to#30640
On 1/6/2015 15:13, Eric Sosman wrote:
> On 1/6/2015 5:38 PM, Cecil Westerhof wrote:
>> You can get a Messagebox with:
>>          JOptionPane.showMessageDialog(this,
>>                                        "Message",
>>                                        "Title",
>>                                        JOptionPane.INFORMATION_MESSAGE,
>>                                        null);
>>
>> The problem is that I work with Linux and have several desktops. The
>> messagebox is displayed on the desktop where the program is running.
>> Is there a method to get the messagebox on the current desktop?
>
>      I don't know, but I'd be willing to bet that the first
> argument will have to be something other than "this".  See
> if you can find some likely alternatives to try in that spot.
>

Or use one of the JDialog constructors that takes a GraphicsConfiguration.

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


#30643

FromJeff Higgins <jeff@invalid.invalid>
Date2015-01-07 07:14 -0500
Message-ID<m8j81g$1gg$1@dont-email.me>
In reply to#30639
On 01/06/2015 05:38 PM, Cecil Westerhof wrote:
> You can get a Messagebox with:
>          JOptionPane.showMessageDialog(this,
>                                        "Message",
>                                        "Title",
>                                        JOptionPane.INFORMATION_MESSAGE,
>                                        null);
>
> The problem is that I work with Linux and have several desktops. The
> messagebox is displayed on the desktop where the program is running.
> Is there a method to get the messagebox on the current desktop?
>
> For example the program is running on desktop 3. I am working on
> desktop 1. Instead of the messagebox displayed on desktop 3 (where I
> will not see it), I want it displayed on desktop 1.
>
Another problem might be the diversity of Linux distros and
window managers. I'm using Gnome on Debian so I did a search
on gnome+notifications and the first hit was:
<https://wiki.gnome.org/Design/OS/Notifications>.
 From there you may be able to wrangle a Java solution for your
particular setup. A general solution might be harder.

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


#30644

FromJeff Higgins <jeff@invalid.invalid>
Date2015-01-07 07:19 -0500
Message-ID<m8j8am$2ln$1@dont-email.me>
In reply to#30643
On 01/07/2015 07:14 AM, Jeff Higgins wrote:

> A general solution might be harder.
Here you might look to:
<http://www.freedesktop.org/wiki/>.

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


#30645

FromJeff Higgins <jeff@invalid.invalid>
Date2015-01-07 07:39 -0500
Message-ID<m8j9hd$7bv$1@dont-email.me>
In reply to#30643
On 01/07/2015 07:14 AM, Jeff Higgins wrote:

>  From there you may be able to wrangle a Java solution for your
> particular setup.
<http://java-gnome.sourceforge.net/>

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


#30647

FromJeff Higgins <jeff@invalid.invalid>
Date2015-01-07 08:44 -0500
Message-ID<m8jdai$mk4$1@dont-email.me>
In reply to#30645
On 01/07/2015 07:39 AM, Jeff Higgins wrote:
> On 01/07/2015 07:14 AM, Jeff Higgins wrote:
>
>>  From there you may be able to wrangle a Java solution for your
>> particular setup.
> <http://java-gnome.sourceforge.net/>
>
<https://developer.gnome.org/GNotification/>

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


#30653

FromJeff Higgins <jeff@invalid.invalid>
Date2015-01-07 10:17 -0500
Message-ID<m8jip2$dnd$1@dont-email.me>
In reply to#30645
On 01/07/2015 07:39 AM, Jeff Higgins wrote:
> On 01/07/2015 07:14 AM, Jeff Higgins wrote:
>
>>  From there you may be able to wrangle a Java solution for your
>> particular setup.
And then there are these:
<http://www.cyberciti.biz/tips/spice-up-your-unix-linux-shell-scripts.html>

Zenity looks promising for my setup.
Also Whiptail.
Should be usable from Java.
Thanks for prompting me to look.

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


#30654

FromJeff Higgins <jeff@invalid.invalid>
Date2015-01-07 10:37 -0500
Message-ID<m8jjuq$ikk$1@dont-email.me>
In reply to#30653
On 01/07/2015 10:17 AM, Jeff Higgins wrote:
> On 01/07/2015 07:39 AM, Jeff Higgins wrote:
>> On 01/07/2015 07:14 AM, Jeff Higgins wrote:
>>
>>>  From there you may be able to wrangle a Java solution for your
>>> particular setup.
> And then there are these:
> <http://www.cyberciti.biz/tips/spice-up-your-unix-linux-shell-scripts.html>
>
> Zenity looks promising for my setup.
> Also Whiptail.
> Should be usable from Java.
> Thanks for prompting me to look.

Some other alternatives.
<http://alternativeto.net/software/zenity/>

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


#30648

FromJeff Higgins <jeff@invalid.invalid>
Date2015-01-07 09:11 -0500
Message-ID<m8jetc$t5r$1@dont-email.me>
In reply to#30643
On 01/07/2015 07:14 AM, Jeff Higgins wrote:
> On 01/06/2015 05:38 PM, Cecil Westerhof wrote:
>> You can get a Messagebox with:
>>          JOptionPane.showMessageDialog(this,
>>                                        "Message",
>>                                        "Title",
>>                                        JOptionPane.INFORMATION_MESSAGE,
>>                                        null);
>>
>> The problem is that I work with Linux and have several desktops. The
>> messagebox is displayed on the desktop where the program is running.
>> Is there a method to get the messagebox on the current desktop?
>>
>> For example the program is running on desktop 3. I am working on
>> desktop 1. Instead of the messagebox displayed on desktop 3 (where I
>> will not see it), I want it displayed on desktop 1.
>>
> Another problem might be the diversity of Linux distros and
> window managers. I'm using Gnome on Debian so I did a search
> on gnome+notifications and the first hit was:
> <https://wiki.gnome.org/Design/OS/Notifications>.
>  From there you may be able to wrangle a Java solution for your
> particular setup. A general solution might be harder.
>
LOL
At my terminal I type:
jeff@debian:~$ xmessage "Test message from Steve."
and a small dialog appears with the message
"Test message from Steve." along with an OK button!
Should be usable from within a Java program?

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


#30649

FromJeff Higgins <jeff@invalid.invalid>
Date2015-01-07 09:41 -0500
Message-ID<m8jglt$4qg$1@dont-email.me>
In reply to#30648
Even more fun:
xmessage -nearmouse -buttons okay:2, quit:0 -default okay "`fortune`"

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


#30650

FromJeff Higgins <jeff@invalid.invalid>
Date2015-01-07 09:46 -0500
Message-ID<m8jguo$584$1@dont-email.me>
In reply to#30648
On 01/07/2015 09:11 AM, Jeff Higgins wrote:

> LOL
> At my terminal I type:
> jeff@debian:~$ xmessage "Test message from Steve."
> and a small dialog appears with the message
> "Test message from Steve." along with an OK button!
> Should be usable from within a Java program?
>
If I use gmessage instead of xmessage, a notification
is sent to my desktop notification tray. Don't know
yet if I can buttons in there.

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


#30651

FromJeff Higgins <jeff@invalid.invalid>
Date2015-01-07 09:49 -0500
Message-ID<m8jh53$6pi$1@dont-email.me>
In reply to#30650
On 01/07/2015 09:46 AM, Jeff Higgins wrote:
> On 01/07/2015 09:11 AM, Jeff Higgins wrote:
>
>> LOL
>> At my terminal I type:
>> jeff@debian:~$ xmessage "Test message from Steve."
>> and a small dialog appears with the message
>> "Test message from Steve." along with an OK button!
>> Should be usable from within a Java program?
>>
> If I use gmessage instead of xmessage, a notification
> is sent to my desktop notification tray. Don't know
> yet if I can buttons in there.
>
>
Oops, I meant notify-send.

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


#30674

FromArne Vajhøj <arne@vajhoej.dk>
Date2015-01-10 23:04 -0500
Message-ID<54b1f65a$0$288$14726298@news.sunsite.dk>
In reply to#30639
On 1/6/2015 5:38 PM, Cecil Westerhof wrote:
> You can get a Messagebox with:
>          JOptionPane.showMessageDialog(this,
>                                        "Message",
>                                        "Title",
>                                        JOptionPane.INFORMATION_MESSAGE,
>                                        null);
>
> The problem is that I work with Linux and have several desktops. The
> messagebox is displayed on the desktop where the program is running.
> Is there a method to get the messagebox on the current desktop?
>
> For example the program is running on desktop 3. I am working on
> desktop 1. Instead of the messagebox displayed on desktop 3 (where I
> will not see it), I want it displayed on desktop 1.

Try something like:

JFrame f = new 
JFrame(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration());
JOptionPane.showMessageDialog(f, "Test");
f.dispose();

Arne

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


#30675

FromCecil Westerhof <Cecil@decebal.nl>
Date2015-01-11 18:17 +0100
Message-ID<87bnm58cfg.fsf@Equus.decebal.nl>
In reply to#30674
Op Sunday 11 Jan 2015 05:04 CET schreef Arne Vajhøj:

> On 1/6/2015 5:38 PM, Cecil Westerhof wrote:
>> You can get a Messagebox with:
>> JOptionPane.showMessageDialog(this,
>> "Message",
>> "Title",
>> JOptionPane.INFORMATION_MESSAGE,
>> null);
>>
>> The problem is that I work with Linux and have several desktops.
>> The messagebox is displayed on the desktop where the program is
>> running. Is there a method to get the messagebox on the current
>> desktop?
>>
>> For example the program is running on desktop 3. I am working on
>> desktop 1. Instead of the messagebox displayed on desktop 3 (where
>> I will not see it), I want it displayed on desktop 1.
>
> Try something like:
>
> JFrame f = new
> JFrame(GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration());
> JOptionPane.showMessageDialog(f, "Test"); f.dispose();

Thanks, that does what I want.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

[toc] | [prev] | [standalone]


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


csiph-web