[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 353
  • Last Modified:

ToolTip is not being shown for all labels

public void mouseEntered(MouseEvent e) {
            		
            		//for(PathInfo p2:log1.getPathinfolist())
            	    //{
            	for(LogProcess lp1:lo)
            	{   lp1=lo.get(xx);
            		String ename=e.getComponent().getName();
            		//System.out.println(ename);
            		 
            		for(PathInfo p2:lp1.getPathinfolist())
            	    {
            			if(lp1.getAuth().equals(ename))
                	    {
            	    	d1d.add(p2.getFilepath());
            	    	String toolTip ="<html>";
                		for(String line : d1d)
                		{
                		  toolTip += line +"<br>";
                		}
                		toolTip += "</html>";
            			label.setToolTipText(toolTip);
            			
            			//System.out.println("Hover Activated");
            	    	}
            	    }
            	}
            	    	d1d.clear();
            	   zz++;
            	    //}
            		
            	}

Open in new window



In my program labels are added to a panel based on the contents of a linked list.I wanted to implement hover for each label,but comparing values based on the label name and the linked list.However it does not quite seem to work.Can someone help me to find the mistake?
0
akashsuresh
Asked:
akashsuresh
  • 2
1 Solution
 
CEHJCommented:
label.setToolTipText(toolTip);

Open in new window


Only one label has its text set repeatedly, finally getting the last loop value
0
 
CEHJCommented:
:)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now