03 | 09 | 2010
Main Menu
Affiliates
Who's Online
We have 34 guests online
Alexa
Balloon Tips in Java
Written by administrator   
Monday, 26 May 2008 11:54

Rating 3.5/5 (13 votes)

Balloon tips can be used to display informational messages like name validation, password validation etc. A balloon tip consists of message, a “I” icon to indicate that it is an information message, and a close button.

The below picture shows a balloon tip in windows system tray

 

To display similar balloon tips in java you can use the balloon tip library which can be downloaded from https://balloontip.dev.java.net/

The balloon tooltip library provides the following features
1) Shape of balloon, Edged or Rounded
2) Configurable balloon border color and width
3) Configure balloon fill color
4) Various alignment options: Top left, top right, bottom left and bottom right.
5) Configurable Tip location: AUTOMATIC, CENTER, NORTH, NORTHEAST, EAST, SOUTHEAST, SOUTH, SOUTHWEST, WEST, NORTHWEST
6) Show/Hide Close button.
The below applet displays a sample Balloon tip application.

 

To create a balloon tooltip two factory methods are provided in the BalloonTip class.

* BalloonTip.createEdgedBalloonTip(Component attachedComponent, Alignment alignment, Color borderColor, Color fillColor, int borderWidth, int horizontalOffset, int verticalOffset, boolean useCloseButton)

* BalloonTip.createRoundedBalloonTip(Component attachedComponent, Alignment alignment, Color borderColor, Color fillColor, int borderWidth, int horizontalOffset, int verticalOffset, int arcWidth, int arcHeight, boolean useCloseButton)

 

The created balloon tip can be displayed using the setVisible() Method.

 

The below image graphically explains the borderWidth, horizontalOffset and verticalOffset parameters. Other parameter names are self explanatory.

 

 

 

 



Add this page to your favorite Social Bookmarking websites
Reddit! Del.icio.us! JoomlaVote! Google! Live! Facebook! StumbleUpon! Yahoo! Free social bookmarking plugins and extensions for Joomla! websites!
Comments
Search
dim   |84.88.50.xxx |2008-05-27 12:44:57
Nice, the only problem if you wish it outside the applet (I mean rounded).
Adewale Ajiboye  - Applet Issues     |41.219.200.xxx |2008-10-08 21:18:59
Hi. Lovely work. I noticed just one issue. Maybe its because i wasn't paying
enough attention, but the BalloonTip class doesn't seem to work properly in
JApplets. I had to edit the initializePhase2() method of the BalloonTip.java
file to accept JApplets as top level containers. i had to
add
//////////////////////
else if (parent instanceof javax.swing.JApplet)
{
topLevelContainer = ((javax.swing.JApplet)
parent).getLayeredPane();
break;
}
//////// /////////////
to the while
true loop. More Power to you.
Adewale Ajiboye  - Ordering of contents of ProjectDocumentList page     |41.219.224.xxx |2008-10-08 21:51:08
Also, it would be nice if you could reorder the list on the project document
list page in descending order. I bet most people would assume that the latest
version would be at the top. (I know i did).
PS: I ran into the issue in my
above posted comment in both the earliest and latest versions
Yumas   |92.78.242.xxx |2008-12-05 08:21:07
Real nice work. I like it very much 'cause it's so mutable.
Only registered users can write comments!

3.22 Copyright (C) 2007 Alain Georgette / Copyright (C) 2006 Frantisek Hliva. All rights reserved."

Last Updated ( Saturday, 08 August 2009 17:59 )
 
Bottom Ad
Your Ad Here