Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Inline Icons in item detail and title? (Read 1166 times)
Michael Hopkins
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 23
Joined: Apr 5th, 2022
Inline Icons in item detail and title?
May 5th, 2022 at 11:57pm
Print Post  
Is there an easy way to add an icon into the detail or title of an item?

Our goal is to mix both text and icons into the detail and title of the item.

Thanks,

Michael

PS. We are already using the setImage on the item and using that to deliver some information to the user. We are hoping to have a few more in the items title.
  
Back to top
 
IP Logged
 
Slavcho
God Member
*****
Offline


tech.support

Posts: 3152
Joined: Oct 19th, 2005
Re: Inline Icons in item detail and title?
Reply #1 - May 6th, 2022 at 6:46am
Print Post  
Easiest is to use Unicode icons; potentially create your own font file if you need custom images.

Code
Select All
e.getItem().getStyle().setHeaderFont(
	new Font("Segoe UI Emoji", Font.PLAIN, 15));
e.getItem().setHeaderText("coffee \u2615 time");
 



Otherwise it could probably be done with custom drawing using some html rendering library. E.g. if JLabels can display images in their html mode, try solution from https://stackoverflow.com/questions/7774960/swing-html-drawstring

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint