|
StocksMonitor 1.5.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
ObjectColorTip
final class ColorTip
Calls user's attention to an aspect of the GUI (much like a ToolTip) by changing the background color of a component (typically a JLabel) for a few seconds; the component will always revert to its original background color after a short time has passed.
Example use case:
//no initial delay, and show the new color for 2 seconds only ColorTip tip = new ColorTip(0, 2, someLabel, temporaryColor); tip.start();Uses a daemon thread, so this class will not prevent a program from terminating. Will not lock the GUI.
| Constructor Summary | |
|---|---|
ColorTip(int aInitialDelay,
int aActivationInterval,
JComponent aComponent,
Color aTempColor)
Constructor. |
|
| Method Summary | |
|---|---|
(package private) void |
start()
Temporarily change the background color of the component, without interfering with the user's control of the gui, and without preventing program termination. |
| Methods inherited from class Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
ColorTip(int aInitialDelay,
int aActivationInterval,
JComponent aComponent,
Color aTempColor)
aInitialDelay - number of seconds to wait before changing the
background color of aComponent, and must be in range 0..60 (inclusive).aActivationInterval - number of seconds to display aTempColor,
and must be in range 1..60 (inclusive).aComponent - GUI item whose background color will be changed.aTempColor - background color which aComponent will take for
aActivationInterval seconds.| Method Detail |
|---|
void start()
If the target temporary color is the same as the current background color, then do nothing. (This condition occurs when two ColorTip objects are altering the same item at nearly the same time, such that they "overlap".)
|
StocksMonitor 1.5.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||