BallonTip won't show and freeze the Application

This forum is used by users to request and discuss new product features. Please do not use this forum for technical support including bug reports.

Moderator: JIDE Support

Forum rules
Product suggestions only. Please do not use this forum for technical support including bug reports.

BallonTip won't show and freeze the Application

Postby Tobias.Steidle » Wed Jan 28, 2009 8:50 am

Hello I try to use BallonTip in my Application.
But when i execute the following Code, the Application freeze complete (on _ballontip.show(...)) and the BallonTip won't show.
What's going wrong?


Code: Select all
      fPanel.getBtnTest().addActionListener(new ActionListener() {
      
         public void actionPerformed(ActionEvent e) {
               BalloonTip _balloontip; = new BalloonTip(createToolTipContent());
              _balloontip.show(fPanel.getBtnTest(), 0, 0);
         }
      
      });



Code: Select all
    private JPanel createToolTipContent() {
        JPanel panel = new JPanel(new BorderLayout(12, 12));
        panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
        panel.add(new JLabel("Test"));
        JPanel fieldPanel = new JPanel(new BorderLayout(6, 6));
        fieldPanel.setOpaque(false);
        fieldPanel.add(new JLabel("Name:"), BorderLayout.BEFORE_LINE_BEGINS);
        fieldPanel.add(new JTextField(20));
        panel.add(fieldPanel, BorderLayout.AFTER_LAST_LINE);
        panel.setOpaque(false);
        return panel;
    }


Thanks in advance
Tobias.Steidle
 
Posts: 5
Joined: Tue Oct 16, 2007 11:29 pm

Re: BallonTip won't show and freeze the Application

Postby JIDE Support » Wed Jan 28, 2009 11:14 am

I try your code and it works fine for me. Below is my testing code for your information. On one of my tests, it looks like the balloon tip was not shown when I set the position of the button in the top of the frame. However, it's actually hidden. Please try my code and feel free to let us know if you have any further issue.
Code: Select all
import com.jidesoft.tooltip.BalloonTip;

import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class BalloonTipTest {
    JButton ownerButton;

    public BalloonTipTest() {
        JFrame frame = new JFrame("Balloon Tip Test");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        JPanel panel = new JPanel(new GridBagLayout());
        panel.setPreferredSize(new Dimension(400, 400));
        ownerButton = new JButton("Click to show the Balloon Tooltip");
        ownerButton.setToolTipText("Click to show the Balloon Tooltip");
        ownerButton.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                BalloonTip _balloonTip = new BalloonTip(createToolTipContent());
                _balloonTip.show(ownerButton, 0, 0);
            }
        });
        panel.add(ownerButton);

        frame.getContentPane().setLayout(new BorderLayout());
        frame.getContentPane().add(panel, BorderLayout.CENTER);
        frame.setBounds(200,200,200,200);
        frame.pack();
        frame.setVisible(true);
        frame.toFront();
    }

    public static void main(String args[]) {
        new BalloonTipTest();
    }

    private JPanel createToolTipContent() {
        JPanel panel = new JPanel(new BorderLayout(12, 12));
        panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
        panel.add(new JLabel("Test"));
        JPanel fieldPanel = new JPanel(new BorderLayout(6, 6));
        fieldPanel.setOpaque(false);
        fieldPanel.add(new JLabel("Name:"), BorderLayout.BEFORE_LINE_BEGINS);
        fieldPanel.add(new JTextField(20));
        panel.add(fieldPanel, BorderLayout.AFTER_LAST_LINE);
        panel.setOpaque(false);
        return panel;
    }
}

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: BallonTip won't show and freeze the Application

Postby JIDE Support » Wed Jan 28, 2009 11:20 am

I would recommend you debug to see if fPanel.getBtnTest() is the right button you are expecting when _balloontip.show(JComponent, int, int) is invoked.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: BallonTip won't show and freeze the Application

Postby Tobias.Steidle » Thu Jan 29, 2009 12:41 am

Hello your Testcode work's fine with JFrame but in my case i use a JInternalFrame instead a JFrame.
If i use the Button on an JInternalFrame the Application freeze complete.

JFrame -> Code works fine
JInternalFrame -> Application freeze (No exception, it still hangs)

Version of JIDE Components is 2.4.8
Tobias.Steidle
 
Posts: 5
Joined: Tue Oct 16, 2007 11:29 pm

Re: BallonTip won't show and freeze the Application

Postby JIDE Support » Thu Jan 29, 2009 8:38 am

Could you please make a test case for it and post it here?

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: BallonTip won't show and freeze the Application

Postby Tobias.Steidle » Thu Jan 29, 2009 11:15 pm

Here's the Testcode you requested.

Code: Select all

import com.jidesoft.tooltip.BalloonTip;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

    public class BalloonTipTest {
        JButton ownerButton;
       

        public BalloonTipTest() {
           JFrame lRrame = new JFrame("Balloon Tip Test");
            lRrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

            JPanel lPanel = new JPanel(new GridBagLayout());
            lPanel.setPreferredSize(new Dimension(400, 400));
            ownerButton = new JButton("Click to show the Balloon Tooltip");
            ownerButton.setToolTipText("Click to show the Balloon Tooltip");
            ownerButton.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    BalloonTip _balloonTip = new BalloonTip(createToolTipContent());
                    _balloonTip.show(ownerButton, 0, 0);
                }
            });
           
           
            lPanel.add(ownerButton);

            lRrame.getContentPane().setLayout(new BorderLayout());
           
            JDesktopPane lPane = new JDesktopPane();
           
            JInternalFrame lInternalFrame = new JInternalFrame();
         lInternalFrame.setSize(400,300);
         lInternalFrame.setLocation(20,20);
         lInternalFrame.setClosable(true);
         lInternalFrame.getContentPane().add(lPanel, BorderLayout.CENTER);         
         lInternalFrame.setVisible(true);         
         lPane.add(lInternalFrame);
           
         lRrame.setPreferredSize(new Dimension(500, 500));
            lRrame.getContentPane().add(lPane, BorderLayout.CENTER);
            lRrame.setBounds(200,200,200,200);
            lRrame.pack();
            lRrame.setVisible(true);
            lRrame.toFront();
        }

        public static void main(String args[]) {
            new BalloonTipTest();
        }

        private JPanel createToolTipContent() {
            JPanel panel = new JPanel(new BorderLayout(12, 12));
            panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
            panel.add(new JLabel("Test"));
            JPanel fieldPanel = new JPanel(new BorderLayout(6, 6));
            fieldPanel.setOpaque(false);
            fieldPanel.add(new JLabel("Name:"), BorderLayout.BEFORE_LINE_BEGINS);
            fieldPanel.add(new JTextField(20));
            panel.add(fieldPanel, BorderLayout.AFTER_LAST_LINE);
            panel.setOpaque(false);
            return panel;
        }

   
    }

Tobias.Steidle
 
Posts: 5
Joined: Tue Oct 16, 2007 11:29 pm

Re: BallonTip won't show and freeze the Application

Postby JIDE Support » Fri Jan 30, 2009 12:04 am

Thanks for the test case. I reproduced it and fixed it in JideSwingUtilities.java. It is checked in to open source JCL already. I will let you know when it is released.
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: BallonTip won't show and freeze the Application

Postby Tobias.Steidle » Fri Jan 30, 2009 1:08 am

Thanks a lot for your help
Tobias.Steidle
 
Posts: 5
Joined: Tue Oct 16, 2007 11:29 pm

Re: BallonTip won't show and freeze the Application

Postby JIDE Support » Mon Feb 02, 2009 8:03 pm

Just so you know, this is fixed in 2.5.1 which was just released.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am

Re: BallonTip won't show and freeze the Application

Postby Tobias.Steidle » Tue Feb 03, 2009 12:19 am

Hello,
hate to say it, but I've tried it with 2.5.1 and have still the same problem.
Tobias.Steidle
 
Posts: 5
Joined: Tue Oct 16, 2007 11:29 pm

Re: BallonTip won't show and freeze the Application

Postby JIDE Support » Tue Feb 03, 2009 8:38 pm

Sorry about that. I checked JideSwingUtilities.java (in open source JIDE Common Layer) and noticed the changed was overwritten by mistake. I fixed it again. You may grab it from SVN and do a build yourself if you need it urgently.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am


Return to Product Suggestions

Who is online

Users browsing this forum: No registered users and 13 guests

cron