• Post Reply Bookmark Topic Watch Topic
  • New Topic

Multiline Tooltip  RSS feed

 
Joe Myn
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JTree that is populated from a directory, i am trying to display tooltips on the leaf nodes. the tooltips are nothing by the files headers(comments) . The tooltip must display the comments execluding the opening /*, and closing */.

i managed to display the first three lines of the file only.

br = new BufferedReader(new InputStreamReader(new FileInputStream(file)));

if(!file.isDirectory())


line = br.readLine();

if(line == null || line.equals(""))
{
setToolTipText("<html><font color=black><b>Empty File</b></font></html>");
}
else
{
setToolTipText("<html><font color=black><b>" +line+"<br>"+br.readLine()+"<br>"+br.readLine()+"</b></font></html>");
}
}

Any help is appreciated,

Regards
PaPA
 
sasi kala
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

i couldn't understand your problem. but below code is for displaying header comment (Comment at the starting of the file) as tooltip.

Hope This Helps
All The Best
[ January 21, 2005: Message edited by: sasi kala ]
 
Joe Myn
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks sasi your help is appreciated.
The code worked fine.

Thanks,
PaPA.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!