Solved

Bubble Help

Posted on 1998-08-19
6
439 Views
Last Modified: 2010-08-05
How to develop bubble help in java? If a mouse is moved over a button than is there any way we can show a bubble
help next to the mouse pointer. this is possible in most of the Ms windows software. It would be great if someone could
send source code for it too...


0
Comment
Question by:jayeshp
  • 3
  • 2
6 Comments
 
LVL 3

Expert Comment

by:sailwind
ID: 1222143
The answer is the JPopupMenu. It is a part of the JFC swing package for
JDK 1.1. You simply create an instance of it, and add it to the component
that you want it to show up over. I'll follow this up with some source code.
0
 
LVL 4

Expert Comment

by:evijay
ID: 1222144
0
 
LVL 4

Expert Comment

by:evijay
ID: 1222145
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 3

Expert Comment

by:sailwind
ID: 1222146
Oooops, I've mistaken what you were trying to do. What you really want is the
ToolTip. It is very very simple. Simply use the method setToolTipText on whichever
component you want, and viola, the tooltip appears. Below is a simple program
demonstrating this capability.

import com.sun.java.swing.*;

public class toolTest extends JFrame {

    public toolTest() {

        JButton button = new JButton("Button");
        button.setToolTipText("Press me!");

        getContentPane().add(button, "Center");
        setSize(100,50);
        setVisible(true);
    }

    public static void main(String s[]) {
        new toolTest();
    }
}
0
 

Author Comment

by:jayeshp
ID: 1222147
Hi all,
  Thanks for all the help. The answer given by sailwind is
perfect if i am using SWING. Its my mistake that i did not mention i was using JAVA 1.1.4. I have not started development in swing yet so i cannot use JButton component.
  The answer sent my evijay is perfect for java 1.1.4
After implementing the code i can see the  bubble help with
unsigned warning window. I want to get rid of the warning message which comes along with the tooltip in browser.
Can anyone help me in this.
 I than you for all the help again.
JAYESH


0
 
LVL 4

Accepted Solution

by:
evijay earned 50 total points
ID: 1222148
As you know, the help is displayed as a popupwindow. this window in an unsigned applet will be displayed with a warning. if you dont want it, there are two ways

sign the applet

implement the help as a lightweight label in each of the panel which has buttons needing the help. place the label initially in an invisible position (give negative coords for setPosition)
When the help need to be displayed, bring the label in front, position it  and display.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
fibonacci ten numbers 4 45
servlet example issue 6 46
SequenceInputStream example 3 19
Tagging and Merging on Branch 1 29
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question