MultiLine tooltip for the JList item

Hi,
I did the search for the multiline tooltip in this forum and
I found the following link which is kind of what I am looking for
http://www.codeguru.com/java/articles/122.shtml
Since the item tooltip string could be very long (no limit), I would like to truncate it. The line sepearator cannot be based on the \n of
the tooltip text. I am thinking to fix size the JTextArea to: row 4
and columan 40, and put the tooltip text into it (igoring the \n)
with the setLineWrap(true) and setWrapStyleWord(true).
If the JTextArea line goes more than 3, the tooltip text should only
display the first 3 lines of the JTextArea and append "..." at the end
of the 3rd line. Is is possible? Or someone has better idea? Or if
there is sample code out there doing similar thing?
Thanks,
Pin

why not just use html?
return "<html> sometext<br>line2<br>line3</html>";
Of course you'll have to manually break the line up but it's not all
that hard to write.
Mark

Similar Messages

  • How to implement tooltip for the list items for the particular column in sharepoint 2013

    Hi,
    I had created a list, How to implement tooltip for the list items for the particular column in SharePoint 2013.
    Any help will be appreciated

    We can use JavaScript or JQuery to show the tooltips. Refer to the following similar thread.
    http://social.technet.microsoft.com/forums/en/sharepointdevelopmentprevious/thread/1dac3ae0-c9ce-419d-b6dd-08dd48284324
    http://stackoverflow.com/questions/3366515/small-description-window-on-mouse-hover-on-hyperlink
    http://spjsblog.com/2012/02/12/list-view-preview-item-on-hover-sharepoint-2010/

  • Multiline tooltip for JComboBox items.

    Hi, As the title suggests I'd like to create a multiline tooltip for items in a combobox list.
    I have implemented a multiline tooltip renderer which works perfectly on any component except JComboBox items.
    I have also implemented a ListCellRenderer for a combobox that enables tooltips for the combobox items. Also works perfectly, except that they are single line tooltips.
    The tooltip text is read from an xml file, therefore I have no control on how long the line of text is. Most of the time the text also contains newlines.
    This is the method (overridden from JComponent) added to a subclass of a component so that that component uses the MultiLineToolTip:
        public JToolTip createToolTip() {
            MultiLineToolTip tip = new MultiLineToolTip(this);
            tip.setComponent(this);
            return tip;
        }And this is the ListCellRenderer used on the combobox, so that items have (single-line) tooltips enabled:
        private class ToolTipEnabledComboBoxRenderer extends JLabel implements ListCellRenderer{
             public ToolTipEnabledComboBoxRenderer(){
                  setOpaque(true);
             public Component getListCellRendererComponent(JList list,Object value,
                                                              int index,boolean isSelected,
                                                              boolean cellHasFocus) {
                  String entry = (String)value;
                  if (isSelected || cellHasFocus) {
                       this.setBackground(list.getSelectionBackground());
                       setForeground(list.getSelectionForeground());
                  } else {
                       this.setBackground(list.getBackground());
                       setForeground(list.getForeground());
                  this.setText(entry);
                  if(isSelected || cellHasFocus){
                       if(constraint!=null &&combobox!=null &&
                                   constraint.getType() == Constrained.CONTROLLED_VOCABULARY){
                            String tooltip = ((ControlledVocabulary)constraint).getEntryDescription(entry);
                            if(tooltip==null || tooltip.equals("")){
                                 tooltip="";
                            list.setToolTipText(tooltip);
                  return this;
        }It seems to me that what I have to do is subclass the list used by the combobox and override the createToolTip() method. But how can I set the list used by the combobox? As far as I know the only time I can access the list is in the getListCellRendererComponent() method of the ListCellRenderer, in which the list is a parameter.
    Any ideas?
    Don

    Hello,
    <p>Have you seen this one?</p>
    Francois

  • Multiline tooltips for jlist

    How to get different multiline tooltip for different cell of jlist

    There are two different questions here:
    1. To get a multi-line tooltip, use HTML, e.g. "<html>first line<p>second line"
    2. To get item-specific tooltip text in a JList, write your own class that implements ListCellRenderer, as discussed at http://java.sun.com/docs/books/tutorial/uiswing/components/list.html#renderer

  • JCombox clicked shows dropdown, show tooltip for the dropdown

    Hi,
    I want to provide the tooltip for the dropdown of JCombobox for the whole or tooltip to the item where you move the mouse but not click.
    thanx

    Another note.. just found out that it doesnt work with Windows Look And feel... if i use the default, everythings just fine.. Her is the code: What am I doing wrong?
         private class UccComboBoxRenderer extends BasicComboBoxRenderer
              public Component getListCellRendererComponent(
                   JList list,
                   Object value,
                   int index,
                   boolean isSelected,
                   boolean cellHasFocus)
                   if (isSelected)
                        setBackground(list.getSelectionBackground());
                        setForeground(list.getSelectionForeground());
                        if (-1 < index)
                             list.setToolTipText(value.toString());
                   else
                        setBackground(list.getBackground());
                        setForeground(list.getForeground());
                   setText((value == null) ? "" : value.toString());
                   return this;
         }

  • Under Options , Applications There are multiple entries for the same item (Acrobat Document). how can I delete the duplicates?

    Under Options, Applications there are multiple entries for the same item. (Adobe Acrobat) . Three show Adobe Acrobat Reader 9.3 and the other shows (ask) or (save file) with no ability to select Acrobat Reader . Is there a way to edit this list to remove the duplicates and
    the incorrect entry? Adobe installed a very quick update today.

    They are all different. Hover your mouse pointer over each of the "Content Type" descriptions and you should see a "tooltip" to see that each has a different description.
    You need to update your plugins. It is important to keep them updated due to continuing security fixes and improvements in those plug-ins:
    * Adobe Shockwave for Director Netscape plug-in, version 11.5 (you '''<u>may</u>''' need to update)
    * Shockwave Flash 10.1 r53
    * Next Generation Java Plug-in 1.6.0_20 for Mozilla browsers
    #Check your plugin versions: http://www.mozilla.com/en-US/plugincheck/
    #*'''Note: plugin check page does not have information on all plugin versions'''
    #'''Update Shockwave for Director'''
    #*NOTE: this is not the same as Shockwave Flash; this installs the Shockwave Player.
    #*Use Firefox to download and SAVE the installer to your hard drive from the link in the article below (Desktop is a good place so you can find it).
    #*When the download is complete, exit Firefox (File > Exit)
    #*locate and double-click in the installer you just downloaded, let the install complete.
    #*Restart Firefox and check your plugins again.
    #*'''<u>Download link and more information</u>''': http://support.mozilla.com/en-US/kb/Using+the+Shockwave+plugin+with+Firefox
    #'''Update Shockwave Flash'''
    #*Use Firefox to Download and SAVE to your hard drive from the link in article below
    #*SAVE to your Desktop so you can find it
    #*After download completes, close Firefox
    #*Click on the file you just downloaded and install
    #**Note: Vista and Win7 users may need to right-click the installer downloaded and choose "Run as Administrator"
    #**Note: Most browsers other than IE will also get updated with this one download
    #**Note: To update IE, same procedure '''<u>but use IE</u>''' to go: http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_ax.exe
    #*After installation, restart Firefox and check your version again.
    #*'''<u>Download link and other information</u>''': https://support.mozilla.com/en-US/kb/Managing+the+Flash+plugin#Updating_Flash
    #* Also see: http://support.mozilla.com/en-US/kb/Installing+the+Flash+plugin
    #* Also see (if needed): http://kb2.adobe.com/cps/191/tn_19166.html#main_Uninstall
    #'''Update Java:'''
    #* Download and update instructions: https://support.mozilla.com/en-US/kb/Using+the+Java+plugin+with+Firefox

  • FPM: Tooltip for the start button

    Hi FPM experts,
    I have one question/requirement concerning the start button within the FPM GAFfloorplan. I would like to add a tooltip to that button. I know that this button is part of the FPM and can not be influenced during design time.
    Nevertheless I hoped to be able to influence the button during runtime, namely by using the interface  IF_FPM_CNR_GAF and the method DEFINE_BUTTON. According to the Developers Guide for FPM Release 701 this should work for standard buttons. However I did not succeed in using this method.
    When taking a closer look at the signature I also became aware that there is one parameter missing in the signature of the interface that is described within the Developers Guide (IV_SCREEN): To the best of my knowledge this parameter is not available in 7.01/7.1 systems.
    Any help on that topic is appreciated!
    Thanks
    Christian

    Hi,
    Is this your previous thread?
    http://answers.microsoft.com/en-us/windows/forum/windows_7-desktop/how-to-display-tooltip-for-the-start-menu-items/c93e5457-0ac6-4bbd-8a54-ffacbeadf34f
    I have checked with some Windows 7 machines in workgroup, and they are all no infotips from the start menu items, this might by design.
    Besides, please take a look at the below links:
    Start Menu
    Best regards
    Michael
    Michael Shao
    TechNet Community Support

  • How to make a tooltip for incoming list items

    Hi,
    I am trying to make a tooltip with JQuery for incoming list items. People will enter some text in a textfield en those values will be added to a list. I want to make a tooltip for every list item that will be added to the list. I want the text that people fill in in the textfield to be added in the tooltip, is this possible? And how can I do this? Thanks! This is what I have so far..
    <input type="text" id="input" placeholder="Voer item in" /> <button id="button">Toevoegen</button>
    <div id="tooltip"></div>
    $(document).ready(function(e) {
      $('#button').on('click', function (){
      var toevoegen = $('#input').val();
      var verwijderen = '<a href = "#" class = "verwijderen">Verwijderen</a>'
      <!--add list item-->
      $('#boodschappenlijst').prepend('<li>' + toevoegen + '' + '\t' + verwijderen + '</li>');
    <!--remove list item-->
    $('#boodschappenlijst').on('click', '.verwijderen', function(){
      $(this).parent('li').remove();
    <!-textfield empty-->
    $('#input').on('click', function (){
      $(this).val('')
    $('#boodschappenlijst').hover(
    function (){
      $('#tooltip').css('display', 'block')
    function (){
      $('#tooltip').css('display', 'none')
    #tooltip {
      position: absolute;
      top: 100px;
      right: 300px;
      border: 1px solid #000000;
      border-radius: 5px;
      color: black;
      width: 100px;
      display: none;
    The tooltip appears, but I want the text that people fill in in the textfield to be added in the tooltip

    Hi,
    I am trying to make a tooltip with JQuery for incoming list items. People will enter some text in a textfield en those values will be added to a list. I want to make a tooltip for every list item that will be added to the list. I want the text that people fill in in the textfield to be added in the tooltip, is this possible? And how can I do this? Thanks! This is what I have so far..
    <input type="text" id="input" placeholder="Voer item in" /> <button id="button">Toevoegen</button>
    <div id="tooltip"></div>
    $(document).ready(function(e) {
      $('#button').on('click', function (){
      var toevoegen = $('#input').val();
      var verwijderen = '<a href = "#" class = "verwijderen">Verwijderen</a>'
      <!--add list item-->
      $('#boodschappenlijst').prepend('<li>' + toevoegen + '' + '\t' + verwijderen + '</li>');
    <!--remove list item-->
    $('#boodschappenlijst').on('click', '.verwijderen', function(){
      $(this).parent('li').remove();
    <!-textfield empty-->
    $('#input').on('click', function (){
      $(this).val('')
    $('#boodschappenlijst').hover(
    function (){
      $('#tooltip').css('display', 'block')
    function (){
      $('#tooltip').css('display', 'none')
    #tooltip {
      position: absolute;
      top: 100px;
      right: 300px;
      border: 1px solid #000000;
      border-radius: 5px;
      color: black;
      width: 100px;
      display: none;
    The tooltip appears, but I want the text that people fill in in the textfield to be added in the tooltip

  • Tooltip for the Navigation Node - language dependent / translation?

    Is it possible to provide language dependent Tooltip for the Navigation Node.
    I tried the Portal content translation, but there was no possibility to translate the tooltip.
    Talking about this:
    Property ID: com.sap.portal.navigation.Tooltip
    http://help.sap.com/saphelp_nw70ehp2/helpdata/en/49/32a70ee8c45aaae10000000a42189d/frameset.htm

    Hi Van Vi,
    when I get your question right, you are looking for a possibility to change the text of the navigation items, not the text inside a content page, correct?
    I am using MII 12.0.2. The workaround for me was to create different roles like "XMII User EN", "XMII User DE" which contain the navigation item in the according language. The content pages contain tags like Michael mentioned, e.g. {##LBL_KEYWORD} in an *.irpt page. Those tags are set using the language set for the user in the NetWeaver UME.
    Michael, is there a possibility to use this {} notation in the navigation in 12.1, so I do not have to create language based roles?
    Michael

  • Header Details to be Printed only for the line item details.

    Hi All,
    I have the following requirement.
    I have Page1 with the Logo, Header Window, Vendor Window, Send Invoice To, Delivere Invoice To and Main Window. Main Window Starts from the middle of the page. In the Page2 i have Logo, Header window and Main Window. In the Page3 i have only Main Window.
    In the Footer of the Main Window i have Placed the Terms and conditions which should always be Printed in the New Page. So in the footer i have given a command "Go to New Page " and given the page as Page3.
    The requirement is Logo,and Header Window should appear only for the Line items and not for the Terms and conditions.
    For the Page1 i have given the Next Page as Page2. Suppose if there is only one line item then it Prints in the first Page itslef and the control flows to the Page2 and since in the page2 i have given the condition for the Logo and header window to print only if line item is more than 1 and since Main Window is starting from the middle there is a blank Space appearing in the start of the page.
    The command i have given in the footer to trigger new page that is page3 is not getting triggered. If there are more than one line item then its printing the logo and header window and so there is no blank space appearing and it is working fine.
    Please let me know how to avoid this blank space and move my main window to the start of the Page if there is only one line item.
    Thank you.

    Dear Vasudha,
    I am a little bit confused regarding your query,
    "In the Footer of the Main Window i have Placed the Terms and conditions which should always be Printed in the New Page. So in the footer i have given a command "Go to New Page " and given the page as Page3. "
    When you say footer of main window does it mean , that you are using a table inside your main window and the command node your have inserted is in the footer of the table ?.I hope it is, because my suggestion is based on this assumption.
    Well my suggestion for your issue is,
    1.I  hope you are aware we can trigger a next page in two ways, one by setting the next page static attribute & second using  the command node which you have used.In your case you will have to use a combination of both.
    2.I feel your First page design is ok. Set its static next page attribute to PAGE2. Similarly set the static next page attribute for PAGE2 as PAGE2 itself. This should take care of your table which you have placed in the main window. If the table contains only one lineitem it will get over in the first page itself. If the lineitems are more in the table, it will automatically triggerPAGE2 (since static next page attribute for PAGE1 is PAGE2)  and the remaining line items will be displayed. Now no matter how many lineitems you have ,PAGE2 will be triggered repeatedly(since static next page for PAGE2 is PAGE2 itself) until the entire data in your table is displayed.
    In this way your requirement of printing the logo and header windows for the data lineitems only will be fulfilled.
    3.Now the last catch in your case is the printing of PAGE3(The terms and condition page) on an entirely new blank page.
       In the footer section of the table which you have used,  use a command node set to PAGE3.  After the command node and under the same  footer section now insert your terms and condition lineitem.
    Also Check the "at End of table" checkbox and uncheck " AT PAGE BREAK" under OUTPUT OPTIONS tab for the footer section.
    So now this footer section will be triggered only once after all the data in the table is displayed
    4. So now if there is only one lineitem, before the default second page is triggered the command node will trigger the PAGE3 and the terms and condition will be displayed.Else if there are more lineitems the page2 will be triggered again and again and finally when all the lineitems are over, the footer of the table will get triggered. So the command node will take you to the PAGE3 wherin the terms and condition will only be displayed.
    Hope this helps.
    Regards,
    Riju

  • CIN - BED, AED & SED for the excise item is ZERO

    DEAR ALL,
    I am testing the CIN scanario with tax procedure TAXINJ.
    While making GRN at excise invoice tab message is coming " BED, AED and SED for the excise item is zero" adn no any values for BED, AED and SED are flowing,
    Value for BED is maintained in J1ID for the chapter ID. Also Tax code is created with JMO1 - IN: A/P BED deductible and value mainatained is 14 %.
    PLease confirm me where I amd doing wrong ? Also please tell in TAXINJ on what paramaters the excise flows and shows the values while GRN OR whil posting a excise invoice ?
    Regards,
    Rakesh

    Dear ALL,
    Below are the steps / settings I have done,
    01. Copied TAXINJ to create tax procedure say ZAXINJ and assigned to country IN.
         - Please confirm what needs to be AltCty & AltCBV for JMO1, JMOD, JMOP ?
    02. Excise defaults maintained as per TAXINJ for ZAXINJ.
    03. Acces sequenece maintained for JMO1, JMOP, JMOD is MWST - Tax code.
    04. Then created Tax code say T1 - and % maintained as below
           JMO1 - 100 %
           JMOP - 100 %\
    05. J1ID - maintained for vendor, plant, material etc.
    05. Excise rate maintained in J1ID for chapter ID as 14 %.
    06. Chapter ID maintained in material master.
    07. PO created for the material with tax code T1 for the said vendor.
    Still while GRN message comes "BED, AED & SED for the excise item is ZERO" and BED is not getting populated for BED.
    Please confirm where I went.
    Waiting eagerly for the valuabale inputs..
    Regards,
    Rakesh

  • Hello everyone, I have a problem when I sync my apple device. I plug it in and a message comes up saying, this device could not be synced because this computer is not authorized for the purchased items on this phone. I already tried to authorize again.

    Hello everyone, I have a problem when I sync my apple device. I plug it in and a message comes up saying, this device could not be synced because this computer is not authorized for the purchased items on this phone. I already tried to authorize again, after deautherizing it. HELP ME PLEASE

    Hi applerinneedforhelp,
    Thanks for visiting Apple Support Communities.
    If iTunes is asking you to authorize the computer, and you've already done so, the troubleshooting steps in this article can help:
    iTunes repeatedly prompts to authorize computer to play iTunes Store purchases
    http://support.apple.com/kb/ts1389
    Regards,
    Jeremy

  • 14th May 2013. We placed an order on medIT (Medit Information Technology)for the following items: 6 units of Apple iMAc-All_in-one-1 core i

    14th May 2013.
    We placed an order on medIT (Medit Information Technology) for the following items:
    6 units of Apple iMAc-All_in-one-1 core i5 2.9 GHz-RAM 8GB-HDD 1x1tb-GF GTX 660M- Gigabit LAN-WLAN : 802.11 a/b/g/n, Bluetooth 4.0-OS x 10.8 Mountain Lion- Monitor : LED 27”wide- keyboard: English.
    We paid to their account; Bank of Cyprus Public Company Limited the full invoice value.
    As of today 14th May 2013 we are still waiting for delivery of the goods despite numerous advices that a partial order of 3 items the order has been shipped.
    We have made numerous follow up calls to medIT directly and through other customers of medIT, but we have no clue as to when we will receive the goods. On 29th April, 2013 they gave us a FEDEX airwaybill no..We regret that we have not been able to trace this airwaybill on the FEDEX system.
    We are, therefore,  pleading for assistance from any support group to link us with the right department so that we can have accurate information on the movement of this parcel.
    These items were ordered for a government department of the Republic of Zambia and this non-delivery is creating a bad name for Apple Resellers covering Zambian market. The project upgrade of the project is now falling behind due to non-delivery on our part arising from the non-performance on the part of medIT.
    We can make available for inspection copies of the order and remittance details to the appropriate office for review and ready reference.
    We can be contacted directly on “James A. Ngoma”
    <Personal Information Edited by Host>

    If you ordered from MedIT in Cyprus, they do not appear to be an authorized Apple reseller. If they are indeed not authorized by Apple, there will be nothing Apple will be able to do to assist you in this matter. You will need to work the problem out with MedIT, obtaining legal assistance in Cyprus if necessary.
    Regards.

  • How to set the column order of a sealed column in a custom Content Type for the new item form NewDocSet.aspx?

    Dear SharePoint Developers,
    Please help.
    I need to know How to set the column order of a sealed column in a custom Content Type for the new item form NewDocSet.aspx?
    I think this is a "sealed column", whatever that is, which is  shown in SPD 2013 as a column of content type "document, folder, MyCustomContentType".
    I know when I set the column order in my custom Content Type settings page, it is correct.
    But, when I load the NewDocSet.aspx page, the column order that I set in the settings page is NOT used for this "sealed column" which is bad.
    Can you help?
    Please advise.
    Thanks.
    Mark Kamoski
    -- Mark Kamoski

    Hi,
    According to your post, my understanding is that you want to set the column order of a sealed column in a custom Content Type for the new item form NewDocSet.aspx.
    Per my knowledge, if you have Content Type management enabled for the list or library (if you see a list of content type with the option to add more), the display order of columns is set for each content type.
    Drill down into one of them and you'll see the option under the list of columns for that content type.
    To apply the column order in the NewDocSet.aspx page, you need to:
    Select Site Settings, under Site Collection Administration, click Content type publishing. In the Refresh All Published
    Content Types section, choose Refresh all published content types on next
    update.
    Run two timer jobs(Content Type Hub, Content Type Subscriber) in central admin(Central Administration--> Monitoring--> Review timer jobs).
    More information:
    http://sharepoint.stackexchange.com/questions/95028/content-types-not-refreshing-on-sp-online
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • Enter the price for the service item

    Dear Experts,
    We are implementing SRM 7.0 and we have upgraded our system with Service pack 7.Created a limit SC and approved at all levels. After approving SC system created PO in SRM but did not replicate to backend ECC system. When I looked PO in edit PO mode and system throws an error message "Enter the price for the service item".
    Have any body faced this issue? If yes please guide me how to fix this issue or Suggest me any useful link or OSS messages.
    Thanks in advance.
    Thanks
    Umakanth

    Hello,
    I assume you are using a Product category configured for Extended Classic scenario.
    In this case a limit item in SC creates limit item in PO(in SRM). But when this PO is replicated to R/3, it always creates item with type 'D' for limit item in PO.
    Now with respect to error message you get, can you check if you have specified all LImits (Overall value, Expected value etc)?
    You can also try creating a PO directly in SRM with limit item (use same Product category as above) and see if it replicates.
    If you get the same error, please raise a OSS message for SAP.
    Thanks,
    Sushil

Maybe you are looking for

  • I Cant Open my iTunes all together error 7 (windows error 998)

    hello, i cant get my itunes to open i don't know what i did i might have deleted something i shouldn't have and this happend, when i try to open itunes it says: _*itunes was not installed correctly. please reinstall itunes. Error 7 (windows error 998

  • Can't open .jar file

    I'm running OS X 10.9.1 on a MacBook Air with the newest Java. For some reason, whenever I try to open a .jar file, it gives me a message saying "The Java JAR file... could not be launched. Check the console for possible error messages." How do I get

  • Upgrading Envy 17 3D primary HDD to a SSD

    I was wondering the steps I would need to take inorder to upgrade my current 640GB 7200 HDD to a SSD.I read this thread about the compatibility so I am aware of some issues I may have. http://h30434.www3.hp.com/t5/Hardware-Upgrades-Replacements/Envy-

  • Best guide or tutorial for oracle 10 g rac on vmware ?

    hi, can any one tell me best guide ,notes or Tutorial for oracle 10 g rac on vmware ? Regards, A.Anwar

  • Any need for conversation from big endian and little endian?

    Hi, I am planning to migrate an Oracle 9i Database on AIX 5.3 to Oracle 11g R2 Windows 2008, and have planned to use transportable tablespace. But prior to that task is the conversation required from big endian and little endian using RMAN? Appreciat