Manually invoke and display tooltip text??

Hi all, can any one give me advice how I can manually invoke JComponent's toolTip to become visible,and eventually to keep it visible until user makes some actions..Is it possible.
Thanks in advance..

Looks hard. You can manually show the tooltip by dispatching a ctrl-f1 key to the component.
aComponent.dispatchEvent(new KeyEvent(aComponent, KeyEvent.KEY_PRESSED, 0, KeyEvent.CTRL_MASK, KeyEvent.VK_F1));
You can make all tooltips last a long time with
ToolTipManager.sharedInstance().setDismissDelay(Integer.MAX_VALUE);
but this applies to all tooltips, not just the one you are interested in.
I looked at the source for ToolTipManager to see how it worked and see if it could be emulated. The showTipWindow() method looked the most promising, and you could use
Tooltip aTip = aComponent.createTooltip();
... blah, blah ...
PopupFactory popupFactory = PopupFactory.getSharedInstance();
Popup tipWindow = popupFactory.getPopup(insideComponent, tip,
                         location.x,
                         location.y);
tipWindow.show();
to show your own tooltip. But this means you will have to know when to hide it. TooltipManager adds a mouselistener to the window containing the component, but this is only good for mouse events. What if they are typing?
Hope this helps...

Similar Messages

  • Manually invoke and display tooltip ?

    Hi All !
    Can any one give me advice how I can manually invoke JComponent's ToolTip to become visible such as when user choose a menuitem then the tooltip of another compomnent on the GUI will appear ..Is it possible ? Can you give me a sample source code ?
    Thanks in advance,
    Huy.

    The tooltip of any component can be displayed by typing Ctrl+F1, so try:
    component.dispatchEvent( new KeyEvent (component, KeyEvent.KEY_PRESSED, 0, KeyEvent.CTRL_MASK, KeyEvent.VK_F1, KeyEvent.CHAR_UNDEFINED) );

  • I get a dialogue box asking "What should Firefox do with this file" Options open with or save file. My wife selected save file and now it only opens note pad and displays the text of the file to be saved. OK in windows Internet Explorer.

    I get a dialogue box asking "What should Firefox do with this file" Options open with or save file. My wife selected save file and now it only opens note pad and displays the text of the file to be saved. OK in windows Internet Explorer.

    P.S. Site is http://www.coldwatercreek.com

  • Read a file and display in text box?

    hello,
    i need a program to read a text file in local hard disk and display in textbox using jsp?

    the easiest way for me is :
    try{
    int i;
    out.println("<TEXTAREA>");//initiate text area
    String filename="yourfilename";
    FileInputStream f=new FileInputStream(filename);
    //here you write the contents of the file
    while((i = f.read()) != -1){
    out.write((char)i);
    }catch(Exception e){
    System.out.println(e);
    out.println(</TEXTAREA>);

  • Include text file and display from text file

    Ok. I'm found the site with the monkey on the the flash thing and all it shows is a name, email and something else and I used it and it works by including a txt file and displaying text from that file as putting down this information
    name.text = this.name;
    and I can't find the site anymore to get help.
    I want to know how to include a PHP script that shows this information like this
    text=something I need&username=My Name&email=[email protected]
    I want to show this stuff on the flash but every time I execute by using it as localhost/test.php, it will show a sentax error.
    This is really stressing me out and I need a lot of help on this stuff.
    Can someone help me?

    ok. let me describe something else.
    there's 3 text boxes that is dynamic text.
    one of them is called name
    the other one is called email
    and last one is called location
    in the text file, it shows this for importing to the flash file
    name=My Name&email=EMAIL&location=My Location
    When viewing the flash file that you created, it shows the name, it shows the email, and it shows location.
    When I do it on my own even with a text file, it keeps on saying that there is an error on line 1.
    I found a site that shows how to do it and it shows what to put in a text file, and it shows the action script. On the FLA file that he shows me has a monkey on the flash file and it has 3 text boxes that I described above. As well as the text file, it is the same. I used the example and it worked but I can't find the example again. I don't know what happened to the website and I don't know what happened to the download I had but it is not downloaded any more. I have adanced systemcare pro so it clears out my recent web searches and my recent downloads so I can't find it. I did a google search on anything about action scripts. I even did a monkey action script search and I couldn't find it.
    It's making me mad and I don't know what to do. This is stressing me out way more than you think.
    UPDATE:
    I did a google search on a file I found in my www folder and I found it. finally.
    Here's the site.
    http://www.kirupa.com/developer/mx/externaldata.htm
    now, I need to figure out how to load it from a PHP file.

  • Extract Year (only) from Date Field and Display in Text Field

    I need to extract the year from a user entered date field and display the year in a text field. Can someone help me with the correct script to do this?

    Hi,
    that's quite easy to realize with FormCalc.
    In you date fields exit event add the following code:
    textField1 = Num2Date( Date2Num($.formattedValue, "MM/DD/YYYY"), "YYYY")
    Note: This sample assumes that your date field formats the date with "MM/DD/YYYY". You may have to change the pattern to make it work at your end.

  • How do I create and display a text file?

    Hello friends,
    I am trying to create a simple unix like operating system with very basic functionality. I have a hard time trying to create a "mktext" file and actually display the contents of the text file with the "cat" command. For example:
    // If I type
    $$ mktext test.txt "We are one"
    $$ Text file is created
    // And if I type
    $$ cat test.txt
    // This line will appear
    $$ "We are one" // Only the contents of the test.txt will display.
    That is what I want to do, but currently stuck. I would appreciate any help and suggestions. Thanks...

    This will do it:
    import java.io.*;
    import java.util.*;
    public class Osys
         BufferedReader keyboard = new BufferedReader(new InputStreamReader(System.in));
    public Osys()
         try
              while(true)
                   System.out.print("$$ ");
                   String s = keyboard.readLine();
                   analize(s);
         catch(Exception e){}
    private void analize(String s)
         if (s.trim().equals("")) return;
         StringTokenizer st = new StringTokenizer(s," ");
         if (!st.hasMoreTokens()) return;
         String s1 = st.nextToken();
         if (s1.equals("cat"))
              if (st.hasMoreTokens()) readIt(st.nextToken().trim());
              System.out.println("");  
              return;
         if (s1.equals("mktext"))
              if (st.hasMoreTokens()) writeIt(st.nextToken().trim(),s);
              System.out.println("");
              return;
    // write
    private void writeIt(String file, String line)
         BufferedWriter writer;
         StringTokenizer st = new StringTokenizer(line,"\"");
         if (st.countTokens() != 2) return;
         st.nextToken();
         try
              writer  = new BufferedWriter(new FileWriter(file));
                 writer.write(st.nextToken()); 
              writer.close();
              System.out.println("$$ Text file is created");  
         catch (IOException e)
               System.out.println(""+e);  
    // read
    private void readIt(String file)
         BufferedReader reader = null;
         String         read   = null;
         try
             reader = new BufferedReader(new FileReader(file));
              while( (read = reader.readLine()) != null)
                  System.out.println("$$ "+read);  
              reader.close();
         catch (IOException e)
               System.out.println(""+e);  
    public static void main(String[] args)
         new Osys();
    }Noah

  • Reading Ascii file and display in Text

    I have a file containes ascii code, can i read in in a form of text using java, or i have to convert it to text? Any idea?

    The ascii file was converted from binary file, intend to use Java to view it as a text and save it. The sample ascii codes are listed below. kindly have a look.
    "[email protected].", 24, 25401, -481703714, 0.000, -0.000
    ".D..Q..!..", 46, -15828, -1606219592, 802866557195523194880.000, 0.000
    "b..Y....(?", -30, 16800, 423994384, -0.000, 0.000
    "]*.....F..", 120, 10035, -1588323828, -0.000, 0.000
    "R...9...ac", -92, -22320, 91620164, -364193873920.000, -0.000
    "..8d..9.(.", -80, -24735, -1019651914, 0.000, -237768.381
    Pls comment on it ...
    Thanks,
    Best Rgds,
    _calv                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • I want to open a text file and display it within Lookout 5.0

    How do you read and display a text file within Lookout 5.0?

    Hi Kenneth,
    This should have been trivial, but isn't. Well, it isn't that difficult either. Here's the trick:
    Create a DataSocket Object. For the URL, type: file:c:\ni\lookout5\test.txt[text]
    Leave the Update mode as Automatic for now. Connect a Switch to the Connect member of the DataSocket object.
    On the panel, drag-and-drop the DataSocket.data.txt. Toggle the Switch and voila you have the text in Lookout! I have attached an example (detach the txt file to your C drive; or change the path in the DataSocket object).
    For the curious, DataSocket is a NI networking technology which supports ftp, http, file, and other protocols. See this
    >FAQ f
    or general info' on DataSockets.
    Hope this helps,
    Khalid
    Attachments:
    test.txt ‏1 KB
    readtext.lks ‏2 KB

  • How to set "Display as Text" field with AJAX select list

    thanks Denes for your posting. I'm trying to use the Denes Kubicek code to populate a "Display as Text" field. It works for Text Field (disabled), but not "Display as Text" field(saves state) . In my applciation I need to show this field only (not the disabled text box) when a select list value is changed. any ideas to modify the code below are appreciated.
    http://htmldb.oracle.com/pls/otn/f?p=31517:80:3418128396960418::NO
    here is the code from the url above
    1. Create an Application Process - getDet:
    DECLARE
    my_det VARCHAR2 (200);
    BEGIN
    SELECT ename || CHR(10) || job || CHR(10) || mgr
    INTO my_det
    FROM emp
    WHERE empno = :P80_EMPLOYEES;
    HTP.prn (my_det);
    END;
    2. Put the following in the Region Header of your page:
    <script language="JavaScript" type="text/javascript">
    function f_getDet ()
    var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=getDet',0);
    get.add('P80_EMPLOYEES',html_GetElement('P80_EMPLOYEES').value)
    gReturn = get.get();
    if(gReturn)
    {  html_GetElement('P80_DETAILS').value = gReturn  }
    else
    {  html_GetElement('P80_DETAILS').value = 'null'  }
    get = null;
    </script>
    3. Put the following in the HTML Form Element Attributes of :P80_EMPLOYEES:
    onChange="f_getDet()";

    Arie,
    this works fine on normal page, except page zero. I have the AJAX select list and "Display as Text" field on page zero. The "Display as Text" field doesn't show the the value when AJAX select is changed. I'm using similar code as used in my other APEX page on OTN site. I tired to display the gReturn value, just before calling "setDisplayOnlyNode" function in the code below and it's showing correct value, but fails to display the value in the APEX field on page zero. Any ideas are appreciated.
    Thanks,
    Surya
    <script language="JavaScript" type="text/javascript">
    function setDisplayOnlyNode(pItem, pValue)
    { var textNode = pItem + '_DISPLAY'; $x(textNode).innerText = pValue; }
    function f_getDet ()
    var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=getDet',0);
    get.add('P1_EMPLOYEES',html_GetElement('P1_EMPLOYEES').value)
    gReturn = get.get();
    if(gReturn)
    { setDisplayOnlyNode('P1_DETAILS',gReturn)}
    {  html_GetElement('P1_TEST').value = gReturn  }
    get = null;
    </script>

  • How to display korean text in file name

    Hi, I want to know how to make my system recognize and display Korean text in file names and such. My mp3 files are all a bunch of gibberish and they display that way in the itunes as well; the title, artist, and everything else.
    How can I fix this?

    Thanks. I tried that but the application wouldn't save any of the files for some reason.
    But it made me look for something else. In iTunes, I selected the song and right clicked, selected Convert ID3 Tags-->Reverse Unicode. Then it went to Chinese I think. I did the same thing again and it finally went to Korean.

  • How to display Long text information in my view

    Hi
    I have a long text of static information , which i need to show in my view. its like agreement information. The user must be able to read it . It has some 20 lines of text. Which is the appropriate control to be used to show the information ?

    Hi Naresh
    I had some options of displaying the long text in the view.
    option 1 - The long text in sap table was in multiple rows in terms of having each line as one record and when displayed looks like  a paragraph statement. So I used a webdynpro table to populate the rows and made invisible the row/column lines. So When you run it on the browser it will display like a long text. By default, SAP table will have column some length of 72 characters, which I changed to 140 charcs, to get a long sentence formation.
    option 2 - If the long text is not from SAP table and its kind of direct information, then just keep on pasting the text in the text view by providing spaces appropriately, so that the display will be a continous form of paragraph. This is a trial and error way and providing the spaces between the lines.
    option 3 - Store the long text in a text file and call a import parameter, which will read the whole text and store it in string (node) and display it text view. ( alignment cannot be gauranteed)
    option 4 - Last one, is to call a office (msword) or a pdf control , which will display the long text through the word editor or a pdf form.
    If you have any specific issues do write back to the forum.
    thanks
    sathya

  • Opening files and viewing the text

    I'm trying to write a method to open a .doc file and display the text to screen, the program runs but nothing appears on the screen. Is the code below the correct way or is it flawed.
    class Open implements ActionListener
              public void actionPerformed(ActionEvent event)
                   try {
                   JTextPane view = app.setScreen();
                 BufferedReader in = new BufferedReader(new FileReader("outfilename.doc"));
                 String str;
                 while ((str = in.readLine()) != null) {
                 view.setText(str);     
            in.close();
        } catch (IOException e) {
         }

    I'm trying to write a method to open a .doc file and
    display the text to screen, the program runs but
    nothing appears on the screen. Is the code below the
    correct way or is it flawed.
    class Open implements ActionListener
              public void actionPerformed(ActionEvent event)
                   try {
                   JTextPane view = app.setScreen();
    BufferedReader in = new BufferedReader(new
    w FileReader("outfilename.doc"));
         String str;
         while ((str = in.readLine()) != null) {
         view.setText(str);     
    in.close();
    atch (IOException e) {
    Hard to tell why you aren't getting any output without more of the program.
    One thing I see is that this classes replaces the text of JTextPane with the last string read from the file. If the last string were a blank line then you would have nothing to show.
    If you are assuming this is a reasonable size document then you might consider appending each line read into as StringBuffer then set the text of the JTextPane to the contents of the StringBuffer after the reaches then end.

  • Characters displaying headers texts in a sales order

    We are upgrading from 4.6C to ECC 6.0 and we have detected a problem with texts in sales orders.
    The problem is easy to explain, after entering a text with more than one line, when you enter again in transaction VA02 (or VA03) and display the text, you can see the characters & #13;& #10; connecting the lines. In the other side, when you push the botton to display the text in a full screen, the information in displayed correctly.
    Here an example. You enter the following text:
        "This sales order needs to be checked continously.
        Please, call the salesman if a change is needed."
    When you display again de text you see:
       "This sales order needs to be checked   continously.& # 13;& # 10;Please, call the salesman if a change is needed."
    Initially we detected the problem after using own programs that use function SAVE_TEXT but then we have seen the same problem using directly the transaction VA02.
    We have checked customizing trying to find a reason without success.
    Any idea about the reason of this problem?
    Thanks in advance

    Dear Albert,
    We had the same issue ealier.....Pl check with your Basis team whether patch updation is done to the full.
    Thanks
    Ivy

  • Display item values by ToolTip text

    Hi
    Dear Friends & Gurus,
    I'm using Forms 6i. Now I have a multi record block in which I am showing the Employee records(empno,ename,job,sal and so on..) My requirement is when I change the value of salary and employee name or any column value and move to next item when i place the mouse back on to this Sal, ename text field it must be displayed the old salary and ename value by ToolTip text. I thought of achieving this by ToolTip_text.And which trigger i will use to perform these tasks.
    Please help me .It is urgent - please help.
    Thank you.
    With Kind Regards,

    Hi,
    Try using a combination of the following:
    a) find the original value on database with:
    GET_ITEM_PROPERTY(item_name VARCHAR2,property NUMBER);
    item_name = your_item
    property = DATABASE_VALUE
    b) Then set the tooltip property
    SET_ITEM_PROPERTY(item_name VARCHAR2,property NUMBER,value VARCHAR2);
    item_name = your_item
    property = TOOLTIP_PROPERTY
    value = GET_ITEM_PROPERTY("your_item",DATABASE_VALUE);
    Regards,
    Hugo.

Maybe you are looking for

  • Vibrate / Silent function has a mind of it's own!

    Hi guys and gals, OK so I've signed up as I've just discovered a fault with my iPhone3 3GS, done a bit of googling and found others have had the same problem, wanted to see what you guys thought of it. I bought the phone August 2009 brand new. After

  • TS4062 Sync iPhone with iTunes Problem

    I cannot figure out how to resolve iPhone iTunes sync error message: "message" was not copied to the iPhone because it could not be found.  Note: I just changed email address in iTunes, did that mess things up too? (same type problem with iPad 3 too)

  • Regarding :Modifying the partition key column

    Hi, I have Create one table.At that time i did range partition on one column(callend).these table has 1000 millions records.Now I want to chage that partiion on another column (callstart) .How can i do this. Kindly provide me suggestion Regards.

  • How to Use SDK compile all MXML file in project ?

    Who can teach me ? Plz 1.How to Use Adobe SDK to compile all MXML file in project ? 2.How to Use Ant to compile all MXML file in project ? Thanks everyone !!

  • Owa_custom and 403 Forbidden

    In my web application, I am using owa_custom to check and set cookies for authorization. All this is working nicely. When owa_custom returns false, it redirects to 403 Forbidden and execution stops. Is there a way alter what the 403 pages looks like?