Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / August 2006

Tip: Looking for answers? Try searching our database.

Trying to get attention to a component

Thread view: 
tiewknvc9 - 09 Aug 2006 03:14 GMT
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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.