Change Wallpaper In Linux Using Java

S

Stewart Berman

Warning: Newbie

I am trying to get familiar with Java as a desktop application
development tool. I wrote a small application that allows the user to
select a set of images (bitmaps and jpegs), order them, set the
display time interval for each and have them rotate through as Windows
wallpaper. This started as a port from Visual Basic 6 and then I
decided that it was better to start over and separate the GUI from the
Code.

It works fine under Windows using a JNI dll.

Now, what do I need to do to make it work under Linux? Is there
support for Linux dependent code in Java or do I need to create the
equivalent of the Windows JNI dll but for Linux? If so, is there a
how to or at least a sample of interface between Java and native
Linux?
 
D

Daniel Pitts

Stewart said:
Warning: Newbie

I am trying to get familiar with Java as a desktop application
development tool. I wrote a small application that allows the user to
select a set of images (bitmaps and jpegs), order them, set the
display time interval for each and have them rotate through as Windows
wallpaper. This started as a port from Visual Basic 6 and then I
decided that it was better to start over and separate the GUI from the
Code.

It works fine under Windows using a JNI dll.

Now, what do I need to do to make it work under Linux? Is there
support for Linux dependent code in Java or do I need to create the
equivalent of the Windows JNI dll but for Linux? If so, is there a
how to or at least a sample of interface between Java and native
Linux?

Please be patient. This isn't some simple forum where you need to
"boost" your message after some time. Many people read this newsgroup
from many different timezones. Most of the regular readers *will*
eventually see your message. The few regular readers that know the
answer will be more likely to give you the answer (or a lead) if you
don't "spam" the group.

Good luck,
Daniel.
 
A

Andrew Thompson

On Jun 3, 2:13 pm, Daniel Pitts
Please be patient.  

That is good advice, but I suspect the OP
reposted the question due to an unfortunate
'spellchecker incident'. There is one word
different between the two posts - and it had
me shaking my head in bemusement.
 
S

Stewart Berman

I discovered an amusing misspelling in my post and sent a cancel
followed by a reposting of the message with the correct spelling. It
appears that this news group ignores the cancel request.

In any advent, can you please answer the question?
 
D

Daniel Pitts

Stewart said:
I discovered an amusing misspelling in my post and sent a cancel
followed by a reposting of the message with the correct spelling. It
appears that this news group ignores the cancel request.

In any advent, can you please answer the question?
Please don't top-post. Hard to follow makes the conversation says Yoda.

Also, no, I can't answer the question, because I don't know the answer.
Chances are that it depends greatly on the environment used, wither it
be Gnome, KDE, or some other windowing system. I suggest checking on a
Linux newsgroup on how to do it programatically in general, and then try
to figure out how to apply that in Java.
 
S

Stewart Berman

The reason I top post is that Agent opens posts at the top not the
bottom. So people that do not need to see the entire email chain can
view only the most recent additions.

Does your use group reader open the post at the bottom?
 
A

Arne Vajhøj

Stewart said:
The reason I top post is that Agent opens posts at the top not the
bottom. So people that do not need to see the entire email chain can
view only the most recent additions.

Does your use group reader open the post at the bottom?

No.

But usenet convention is still oldest content at top and
newest content at bottom, so that reading down is
chronological.

Arne
 
L

Lasse Reichstein Nielsen

Stewart Berman said:
The reason I top post is that Agent opens posts at the top not the
bottom.

My reader puts my cursor at the top too, but that's in the message
header, so I don't write there.
Don't be a slave to your software. Be a slave to convention!
So people that do not need to see the entire email chain can
view only the most recent additions.

It's not email (it's Usenet messages), and you shouldn't include the
entire chain of messages, but only enough to give context to your
reply.

Top posting and full-quoting are two separate netiquette sins, but
they often support each other.

/L
 
D

Daniel Pitts

Stewart said:
The reason I top post is that Agent opens posts at the top not the
bottom. So people that do not need to see the entire email chain can
view only the most recent additions.

Does your use group reader open the post at the bottom?
It opens it at the top, but I would rather press space or page-down a
couple of times to see the context, if I haven't been following a
thread, than to read a thread backwards.

Also, it is the preferred and common practice in, at least this
particular newsgroup, to reply inline, or at least bottom.

This is not an email chain, this is a newsgroup. Often times, replies
*only* make sense if you know the immediate predecessor.

Thanks for explaining your reason. It makes sense to some degree, but
not here.

Thanks,
Daniel.
 
A

Arved Sandstrom

Stewart Berman said:
The reason I top post is that Agent opens posts at the top not the
bottom. So people that do not need to see the entire email chain can
view only the most recent additions.

Yes, and that's email, where it makes good sense.
Does your use group reader open the post at the bottom?

Mine don't. Even if it's a dedicated newsreader, there is no default cursor
start location that works most of the time, let alone all of the time. Where
you actually start quoting - at the bottom, interspersed and near the top,
interspersed and in the middle, etc. - combined with the snipping you ought
to be doing to make the message more intelligible, means that a default
cursor right at the start makes as much sense as anything else. For me it is
more useful than opening at the bottom.

Point being, having the reply draft open at the top doesn't mean I start
typing there.

[ SNIP ]

AHS
 
S

Stewart Berman

Arne Vajhøj said:
No.

But usenet convention is still oldest content at top and
newest content at bottom, so that reading down is
chronological.

Arne

The convention is due to the type of equipment originally used.

There is an experiment that goes like this:

Put eight monkeys in a room with a table. Tie a bunch of bananas
above the table. Whenever a monkey jumps on the table to get to the
bananas hose all of them down with ice water. After a while none of
the monkeys will jump on the table. Replace a monkey. As soon as the
new monkey starts to climb the table the others with stop it -- by
force if necessary. Keep replacing the monkeys. Eventually none of
the monkeys in the room will ever have been sprayed with ice water but
they will stop a new monkey from climbing onto the table. Why --
because they have always done it that way.

If I read a news group every day and have already read the thirty
messages in the thread I don't need to page down to the bottom to see
the last one.

Do you really re-read the thirty prior quotes posted in a long
message? No. You scroll to the bottom and then up to find the first
one you haven't read.

It is easier if the new information is at the top. But "we've always
done it this way" stops people from doing it better. I am a little
surprised to find java programmers in that category but I guess it has
been around long enough for several groups of monkeys to have passed
through.

I guess being new to this -- having only started when the bug in a
relay was real -- I am not constrained as much by meaningless
conventions. But I will try and remember it for the older readers in
this news group.

BTW, no one has actually provided any useful information. The
discussion has only been about form -- not substance. I guess that
must also be a java news group tradition.
 
S

Stewart Berman

Lew said:
When in Rome, ...

You have been asked courteously to follow the courtesy conventions of this
group. You have tried to justify your refusal. Those from whom you seek
advice will not need to justify why they won't answer; you can just recall
your refusal to be nice.

I didn't refuse to be nice. I even bottom posted my last response.

I merely pointed out the fact that all of the responses I received
(which are now up to ten) were only concerned with the format of my
replies and not with providing any response to my original request for
information. They appeared to be designed to stop anyone from
climbing up on the table with information.

I thought my original request was phrased reasonably.

I apologize for wasting this much bandwidth and will seek the
information I need elsewhere.

There is no need to reply unless you wish to discuss this amongst
yourselves. The signal to noise ratio of this thread is zero and I do
not expect it to improve.
 
A

Andrew Thompson

...
I didn't refuse to be nice.  I even bottom posted my last response.

While the subject seems to have come up.
'Bottom posting' is the same in a lot of ways,
but (ironically) worse* than top-posting.

How about 'in-line with trim' - take out
every part of earlier messages no longer
immediately relevant, then put the reply
directly below it?
I merely pointed out the fact that all of the responses I received
(which are now up to ten) were only concerned with the format of my
replies ...(snip)

"First things first" is (I think) the principal
you are observing here. People will decide if
they can help on the technical matter the very
moment this matter of posting is sorted to their
satisfaction.

I can agree with that principal, and have applied
it many times myself. Occasionally it led to a
poster drifting off before we got to the details
of the interesting tech. problem, but so be it.
If they cannot manage to communicate effectively,
I have better things to do.

* See this page for more details
<http://pscode.org/javafaq.html#toppost>
 
L

Lasse Reichstein Nielsen

[setting the system wallpaper from Java]
It works fine under Windows using a JNI dll.

No doubt, anything that can be done by a windows application can
also be done by a windows application run from Java.
Now, what do I need to do to make it work under Linux? Is there
support for Linux dependent code in Java or do I need to create the
equivalent of the Windows JNI dll but for Linux?

To use JNI on Linux, you need a loadable library. Probably a .so file.
Check the documentation of Runtime.load:
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Runtime.html#load(java.lang.String)

I'd consider using a command line program through Runtime.exec instead.
If so, is there a how to or at least a sample of interface between
Java and native Linux?

JNI on Linux (or any other platform) works just like windows JNI. It
just uses that platforms linkable library format.

/L
 
A

Arne Vajhøj

Stewart said:
The convention is due to the type of equipment originally used.

Actually not.

There are no technical difference in reading usenet now and
20 years ago that justifies a change.
If I read a news group every day and have already read the thirty
messages in the thread I don't need to page down to the bottom to see
the last one.

I think that is the core of the problem.

You know that you have read all messages, so you you do not see
it as a problem.

And **** all the other readers that may not have read all
the messages - you do not care.

That egocentric attitude is not the "usenet way".
It is easier if the new information is at the top. But "we've always
done it this way" stops people from doing it better. I am a little
surprised to find java programmers in that category but I guess it has
been around long enough for several groups of monkeys to have passed
through.

I guess being new to this -- having only started when the bug in a
relay was real -- I am not constrained as much by meaningless
conventions. But I will try and remember it for the older readers in
this news group.

BTW, no one has actually provided any useful information. The
discussion has only been about form -- not substance. I guess that
must also be a java news group tradition.

You need to be rather stupid to expect that you can compare people
with monkeys and still expect them to spend time trying to help
you.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top