Hi!
I have an image in my java application that I would like to bring the
users attention to...
dropping this - What I was thinking was to put a JPanel behind the
image, just extending beyond the borders, and change the color of it
constantly, BUT this winds up screwing up my application because it
makes the rest of my application stop working --- things like I must
drag my mouse over the buttons to make the buttons appear. I dont know
why, but I cant get it to work the way I want it to.
So I was wondering if anyone had any ideas for me? Basically I just
want the user to be walked through a simple operation when they first
enter my application. Kind of like a brief tutorial for clueless
users...
Whatever I do, I know that I must make it obvious what they should do
next. You know, hit button A, enter in data in table B, hit tab. that
kind of stuff.
Thanks for the advice!
Lionel - 09 Aug 2006 05:41 GMT
> Hi!
>
[quoted text clipped - 7 lines]
> drag my mouse over the buttons to make the buttons appear. I dont know
> why, but I cant get it to work the way I want it to.
Have a look at/try calling validate() or validateTree() methods in
JPanel (it's defined in Container or something higher up).
Lionel.
Lionel - 09 Aug 2006 05:51 GMT
>> Hi!
>>
[quoted text clipped - 10 lines]
> Have a look at/try calling validate() or validateTree() methods in
> JPanel (it's defined in Container or something higher up).
Oh, and use it on your JPanel that contains all the buttons etc.
Andrew Thompson - 09 Aug 2006 06:28 GMT
(snip 'was that a question?')
...
> So I was wondering if anyone had any ideas for me? Basically I just
> want the user to be walked through a simple operation when they first
[quoted text clipped - 4 lines]
> next. You know, hit button A, enter in data in table B, hit tab. that
> kind of stuff.
JOptionPanes implemented as a Wizard should
do the trick ( at least, those two - combined with
clear instructions to the user - so it had better be
more clear than the opening paragraphs ;).
Andrew T.
dsjoblom@abo.fi - 09 Aug 2006 14:25 GMT
> Hi!
>
[quoted text clipped - 7 lines]
> drag my mouse over the buttons to make the buttons appear. I dont know
> why, but I cant get it to work the way I want it to.
You haven't provided any source code, so it's hard to locate the
problem. However, it sounds like you are trying to flip the colors in
the Swing event thread. Swing is single-threaded so doing this
operation in the event thread will hose the rest of your painting/event
handling code. If this is indeed the problem, try using a swing Timer
to fire the color flip change at desired intervals. See
http://java.sun.com/docs/books/tutorial/uiswing/misc/timer.html for
info on how to use timers. See also
http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html for
tips on how to make your app multithreaded.
If all of this was totally off target, I apologize in advance ;-)
Regards,
Daniel Sjöblom
tiewknvc9 - 09 Aug 2006 21:28 GMT
bingo.
I didnt realize that the jpanel would just take over the entire thread
with the color changes.
I put the jpanel updates into a timer, and just surrounded the button
with 4 jpanels, this worked.
Thanks for the tips!
> > Hi!
> >
[quoted text clipped - 23 lines]
> Regards,
> Daniel Sjöblom