Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Bubble Help

Posted on 1998-08-19
6
Medium Priority
?
445 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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 100 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
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…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Suggested Courses

876 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