Results 1 to 4 of 4
Like Tree1Likes
  • 1 Post By DarrylBurke

Thread: Display problem in tooltip

  1. #1
    NehaKumar is offline Member
    Join Date
    Mar 2013
    Posts
    3
    Rep Power
    0

    Default Display problem in tooltip

    I'm showing a tooltip on mouse over an rectangle object. And I have deployed on 2 servers. In server its working perfectly. But on another server i'm facing problem. On first launch, it working perfectly. On refresh(Web Page refresh) tooltip is not getting displayed, only a small dot is getting displayed instead. I have no clue why it is happening so. Please help me.

    Java Code:
    // My Init method
    public void init() 
        {
    
            Container con = getContentPane();
            setPreferredSize(new Dimension(1500,600));
    
            scroll = new JScrollPane();
            scroll.getHorizontalScrollBar().setUnitIncrement(5000);
            getContentPane().add(scroll,BorderLayout.CENTER);
            setBackground(Color.WHITE);
            scroll.getViewport().add(new ImagePanel());
            scroll.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_ALWAYS);
        }
    // initializing tooltip in constructor
    ImagePanel()
            {
                
                setLayout(null);
                
                toolTip                         = new JPanel();
                label                           = new JLabel();
                
                toolTip.setBackground(Color.BLACK);
                toolTip.setOpaque(false);
                
                label.setHorizontalAlignment(JLabel.LEFT);
                label.setOpaque(true);
                label.setBackground(UIManager.getColor("ToolTip.background"));
                label.setBorder(UIManager.getBorder("ToolTip.border"));
                
                toolTip.add(label);
                add(toolTip);
                
                treePanel       = new JPanel(new GridLayout(1,1));
                treePanel.setBackground(UIManager.getColor("ToolTip.background"));
                treePanel.setBorder(UIManager.getBorder("ToolTip.border"));
                treePanel.setPreferredSize(new Dimension(100, 100));
                add(treePanel,BorderLayout.CENTER);
                
                
            }
    
    // method that displays tooltip
    public void showToolTip(int i,int j,int k,int x,Point p)
            {
                    toolTip.setBounds(p.x-20,p.y,250,155);
                    toolTip.setLocation(p.x, p.y);
                    Font f = new Font("Ariel",Font.PLAIN,12);
                    label.setFont(f);
                    label.setBackground(new Color(0,128,192));
                    label.setForeground(new Color(255,255,255));
                     label.setText("<html>Factory :- "+factory+"<br>Machine :-"+machine+"<br> Ticket ID :- "+ticketID+"<br> Job ID :-"+job+"<br>Start Date :-"+startDate+"<br>End Date :-"+endDate+" <br> Week Day :- "+weekDate+" </html>");
                    ToolTipManager.sharedInstance().registerComponent(label);
    
                     toolTip.add(label);
                     toolTip.setVisible(true);
    Thanks in advance.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,240
    Rep Power
    19

    Default Re: Display problem in tooltip

    PhHein likes this.
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    NehaKumar is offline Member
    Join Date
    Mar 2013
    Posts
    3
    Rep Power
    0

    Default Re: Display problem in tooltip

    Please remove from this forum.
    Quote Originally Posted by DarrylBurke View Post

  4. #4
    NehaKumar is offline Member
    Join Date
    Mar 2013
    Posts
    3
    Rep Power
    0

    Default Re: Display problem in tooltip

    Kindly help me in fixing this problem. Thanks.

Similar Threads

  1. Tooltip HTML format problem
    By danz in forum Java Applets
    Replies: 7
    Last Post: 07-15-2011, 09:22 PM
  2. Tooltip problem with two monitors
    By rogerbacon in forum New To Java
    Replies: 6
    Last Post: 07-12-2010, 03:38 PM
  3. Replies: 1
    Last Post: 06-22-2009, 02:39 AM
  4. tooltip
    By suman in forum New To Java
    Replies: 2
    Last Post: 07-31-2008, 01:57 PM
  5. Problem to ToolTip in Java 3d
    By roshithmca in forum AWT / Swing
    Replies: 1
    Last Post: 02-05-2008, 03:46 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •