Trying to get attention to a component

T

tiewknvc9

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!
 
L

Lionel

tiewknvc9 said:
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.

Have a look at/try calling validate() or validateTree() methods in
JPanel (it's defined in Container or something higher up).

Lionel.
 
L

Lionel

Lionel said:
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.
 
A

Andrew Thompson

tiewknvc9 wrote:
(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
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.

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.
 
D

dsjoblom

tiewknvc9 said:
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.

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
 
T

tiewknvc9

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!
 

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,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top