Graphics, AWT, Swing II part
A JScrollBar is just that, a scroll bar.
Read the Java docs for both classes and the differences should be most apparent.
  
Darryl L. http://welcome.to/mcpierce
 Q: Is it possible to change delays that affect appearing, keeping and
disappearing of tooltip?
Answer: It was difficult to find the answer but finally I found in "Swing" book that is
free to you on our site.
The ToolTipManager is a service class that maintains a shared instance registered
with AppContext. We can access
the ToolTipManager directly by calling its static sharedInstance() method: 
ToolTipManager toolTipManager = ToolTipManager.sharedInstance(); 
Internally this class uses three non repeating Timers with delay times defaulting to
750, 500, and 4000. ToolTipManager uses these Timer's in coordination with mouse
listeners to determine if and when to display a JToolTip with a component's specified
tooltip text. When the mouse enters a components bounds ToolTipManager 
will detect this and wait 750ms until displaying a JToolTip for that component. This is
referred to as the initial delay time. 
A JToolTip will stay visible for 4000ms or until we move the mouse outside of that
component's bounds, whichever comes first. This is referred to as the dismiss delay
time. The 500ms Timer represents the reshow delay time which specifies how soon
the JToolTip we have just seen will appear again when this component is
re entered. 
Each of these delay times can be set using ToolTipManager's setDismissDelay(),
setInitialDelay(), and setReshowDelay() methods. 
ToolTipManager is a very nice service to have implemented for us, but it does have
significant limitations. When we construct our polygonal buttons we will find that it is
not robust enough to support non rectangular components. It is 
also the case that JToolTips are only designed to allow a single line of text.
 Q: How can I test if a JTextField is empty. My code is below but does not work.
if (myJTextField.getText() == " ")
    return true;
else
    return false;
Answer: You have to compare String content, not String handler...so you have to
use 
the equals() method.
For example:
if (myJTextField.getText().equals(""))
    return true;
else
    return false;
Or 
you can test whether text  = =  null, 
then check if myJTextField.getText().length() == 0
file:///F|/a_jsite/350_tips/graphics II.htm (3 of 5) [2001 07 08 11:24:55]






footer




 

 

 

 

 Home | About Us | Network | Services | Support | FAQ | Control Panel | Order Online | Sitemap | Contact

java web hosting

 

Visionwebhosting.net Business web hosting division of Web Design Plus. All rights reserved