Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

J Tool Tips - Strange and Awkward Bug

843806Jul 23 2008 — edited Jul 24 2008
Hello Everyone,

I am having a very strange J Tool Tip bug. Okay first of all, the tool tip that I have created works when it is inside of a single panel for a single label. Basically, what I have is a number of J Labels - each having a unique tool tip. Here is the most basic of my code (notice that I have customized my own Tool Tip to have a yellow background and black foreground):
currentLabel = new JLabel("LABEL TEST")
        {
            // Extends the JLabel and overrides createToolTip() to return a custom tool tip:
            @Override
            public JToolTip createToolTip()
            {
                JToolTip toolTip = super.createToolTip();
                toolTip.setComponent(this);
                toolTip.setBackground(Color.YELLOW);
                toolTip.setForeground(Color.BLACK);
                return toolTip;
            }
        };

        currentLabel.setToolTipText("Testing Tool Tip Message");
Okay, so here's the deal. Here's the tricky part. When I have this label nested inside of a Grid Bag Layout Panel, it works perfectly fine. It shows up when the user's mouse hovers over the label.

Here's my problem. The project that I am working on is actually nested in many complicated panels. This project has about 100 java files, so I am just going to cut it short and let you know which kind of panels it is nested in.

Starting from the lowest panel:

1. J Panel (Grid Bag Layout)
2. J Panel (Box Layout)
3. J Panel (Border Layout)
4. J Split Pane (Right Side)
5. J Panel (Border Layout) (Largest Panel)

One of the things I noticed is that now when I hover over the labels, a very small microscopic blue dot appears right to the left of the mouse cursor. I seriously think this is the Tool Tip, but for some reason it isn't showing any text. The strange thing is that the tool tip works when panels 2, 3, 4, and 5 are non-existent. If you guys have any ideas or suggestions, please let me know! I'd really appreciate it!

Thanks,
Brian
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 21 2008
Added on Jul 23 2008
9 comments
107 views