Adding ToolTip for individual cell in the table

Hi everybody,
Its urgent. I want to add ToolTip for individual cells. What I have implemented, it show same ToolTip for each cell. I want different ToolTip for individual cell.
My cells are not editable, as i need this.
Pleae help me.
Thanks in Advance.
Dawoodzai

Hi,
See this demo pasted below-
import java.awt.*;
import javax.swing.*;
public class SimpleTableDemo extends JFrame {
     public SimpleTableDemo() {
          super("SimpleTableDemo");
          Object[][] data = {
               {"Mary", "Campione", "Snowboarding", new Integer(5), new Boolean(false)},
               {"Alison", "Huml", "Rowing", new Integer(3), new Boolean(true)},
               {"Kathy", "Walrath", "Chasing toddlers", new Integer(2), new Boolean(false)},
               {"Sharon", "Zakhour", "Speed reading", new Integer(20), new Boolean(true)},
               {"Angela", "Lih", "Teaching high school", new Integer(4), new Boolean(false)}
          String[] columnNames = {"First Name", "Last Name", "Sport", "# of Years", "Vegetarian"};
          final JTable table = new MyTable(data, columnNames);
          table.setPreferredScrollableViewportSize(new Dimension(500, 70));
          JScrollPane scrollPane = new JScrollPane(table);
          getContentPane().add(scrollPane, BorderLayout.CENTER);
     public static void main(String[] args) {
          SimpleTableDemo frame = new SimpleTableDemo();
          frame.pack();
          frame.setVisible(true);
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class MyTable extends JTable {
     public MyTable(Object[][] rowData, Object[] columnNames) {
          super(rowData,columnNames);
     public String getToolTipText(MouseEvent e) {
          int r = rowAtPoint(e.getPoint());
          int c = columnAtPoint(e.getPoint());
          return getValueAt(r,c).toString();
}

Similar Messages

  • How can I take check box in particular cell of the table in smartforms??

    Hi experts,
       pls tell me how can I take check box in particular cell of the table in smartforms??
    It is not interactive form.
    I hv taken small windows as check boxes.but i think it is not a proper solution....give me another solution...

    Hi,
    first create text for a particular cell.
    In that we have a  text editor  in that text editor we have symbols in include menu.
    whatever the symboll u want to put to ur cell . just assign it.
    please check it. if it helpful reward points.
    regards,
    satish.

  • Multiline text in cell of the table

    Hi Experts,
    I have internal table wich has field (type STRING).
    Value field is for example '  <?p?>?line1?<?/?p?>?<?p?>?line2?</p>?' Without '?'
    It means that value in one cell of the table should be so :
      line1
      line2
    I cannot to use FormattedTextView for table column.
    What I can to use instead this?
    Thanks in advance
    Evgeniy
    Edited by: Evgeny Vazhev on May 5, 2011 2:03 PM
    Edited by: Evgeny Vazhev on May 5, 2011 2:04 PM

    Since you can't use the formatted UI elements, you will need to remove the XHTML formatting.  I would suggest perform text replacement and removing the
    <p>
    completely and replacing the
    </p>
    with cl_abap_char_utilities=>cr_lf. 
    Try that with the textView. If the carriage return isn't used in the text view, you might swap the UI element to a disabled textEdit UI element instead.

  • On clicking empty cell in the table

    System forces user to enter valid value on clicking empty customised cell in the table. it should not happen eventhough cell is previously empty.

    hi
    Set the table property visibleRowCount property using a context attribute in your code. Set it to the value node (data source) size.
    e.g
    ; wdContext.currentContextElement().set<attributename>(wdContext.node<urnode>().size());
    Hope it helps.
    regards
    LNV

  • [svn:fx-trunk] 5873: Adding support for [Alternative] metadata to the asdoc tool.

    Revision: 5873
    Author: [email protected]
    Date: 2009-04-02 09:46:24 -0700 (Thu, 02 Apr 2009)
    Log Message:
    Adding support for [Alternative] metadata to the asdoc tool.
    QE Notes: None.
    Doc Notes: None.
    Reviewed by: Paul
    tests: checkintests, asdoc
    Modified Paths:
    flex/sdk/trunk/modules/asc/src/java/macromedia/asc/parser/MetaDataEvaluator.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/ClassTable.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/TopLevelClassesGenerator.ja va
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/asdoc/TopLevelGenerator.java
    flex/sdk/trunk/modules/compiler/src/java/flex2/compiler/mxml/lang/StandardDefs.java

  • In InDesign, how can I name individual cells in a table for interactive PDFs?

    Hi, I'm creating interactive PDFs for a client that include tables with empty cells that will be populated afterwards (depending on what information a customer puts in on a form).
    The forms are created in InDesign and exported as interactive PDFs, but I need to be able to name the live fields (in InDesign) before I export the Interactive PDF, so that I don't have to select each indivual field in the final PDF and rename them.
    The reason I want to be able to do this pre-PDF production, is because the forms will be rebranded over and over again and I don't want to have to rename hundreds of cells time and time again in Acrobat Pro.
    The deveopler who's populating the cells already has predefined names for them, so I can's simply give him the names that Acrobat automatically defines.

    What version of InDesign are you using? If CS6 or CC, you can add fields and enter a name for each in the Name field of the Buttons and Forms panel.

  • Adding Effects to text in individual cells of a table

    Hello every one,
    I am creating a five day calendar for a larger day timer. I have used a table to format all my information now I just wanted to add effects to some of the text( drop shadow to the name of the month and what not). Is there a good way to add effects to just one cell of a table? So far I can only add effects to the entire table. I am using Indesign cs5 on a Mac. Also does any one know of a good calendar creating script or template? I am currently using calendar magic but it is a little limited and cant make independent mini calendars or weekly calendars.
    Thanks

    Hi Mike,
    I tried with your suggested solution.
    The text was hypertexed but when i click to display the text which is linked to it is not shown.
    In general text i had linked the Text to a file to open after click on the hypertext by using Append Hypertext Link Anchor to Report.vi by stating the URL or the File Path to its input.
    I am attaching the VI for your reference.
    Thanks & Regards,
    Samriddh Sarbalhi
    Attachments:
    HTML Report Generation.vi ‏44 KB

  • ALV: Dropdown list individual for each line of the table

    Hi
    Question.. I would like to make a dropdown list for a field in the ALV list. The dropdown list is not the difficult point. But this dropdown list should be based on the line item.
    Example:
    Material 100.100     has plants (10, 20, 30)
    Material 100.800     has plants (60, 70)
    so the ALV list should show in the dropdown menu only the plants that this material has.
    As I'm not sure, that my explanations are any good, here a example:
    <u>
    ALV-List</u>
    Material       Description             Plants
    100.100        Screwdriver             (Dropdown list shows only 10,20,30)
    100.800        Hammer                  (Dropdown list shows only 60,70).
    Can anyone tell me if this is feasable? And if so how? Is it do-able with this method?
      call method grid->set_drop_down_table
        exporting
          it_drop_down = lt_dropdown.
    The program BCALV_EDIT_07 has sort of two different dropdown lists.. but I have more then two materials, there would be many lists to create.. (many drop_down_handle's)
    Any other idea?
    I know, this is a tricky one...
    Thanks
    Petra
    Message was edited by:
            Petra

    hi
    i have a code for drop down list use this
    this code is for selection-screen deop-down list yu can add this same code in ALV
    REPORT  ZCHETANA_PRAC10                         .
    Type-pools: VRM.
    data: name type vrm_id,
          list_month type vrm_values,
          list_year type vrm_values,
          value type vrm_value.
    selection-screen: begin of block b with frame.
    parameter: p_year(10) type c as listbox visible length 10,
               p_month(10) type c as listbox visible length 10.
    selection-screen: end of block b.
    at selection-screen output.
    value-key = 'JAN'.
    value-text = 'JAN'.
    append value to list_month.
    value-key = 'FEB'.
    value-text = 'FEB'.
    append value to list_month.
    value-key = 'MAR'.
    value-text = 'MAR'.
    append value to list_month.
    value-key = 'APR'.
    value-text = 'APR'.
    append value to list_month.
    value-key = '1998'.
    value-text = '1998'.
    append value to list_year.
    value-key = '1999'.
    value-text = '1999'.
    append value to list_year.
    value-key = '2000'.
    value-text = '2000'.
    append value to list_year.
    CALL FUNCTION 'VRM_SET_VALUES'
      EXPORTING
        ID                    = 'P_MONTH'
        VALUES                = list_month
    EXCEPTIONS
      ID_ILLEGAL_NAME       = 1
      OTHERS                = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'VRM_SET_VALUES'
      EXPORTING
        ID                    = 'P_YEAR'
        VALUES                = list_year
    EXCEPTIONS
      ID_ILLEGAL_NAME       = 1
      OTHERS                = 2
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    start-of-selection.
    write:/ p_year,
           p_month.

  • Setting cell editor for individual cell in JTable

    Hi there,
    I want to provide individual cell editor for my JTable. Basically, my JTable shows property names and values. I want to show different cell editors for different properties.
    I followed the advice in this post:
    http://forum.java.sun.com/thread.jsp?forum=57&thread=423318
    but I have a question:
    I looked at the code of DefaultCellEditor. It just has a single editor component (the one provided in the constructor), so all the methods use the same component and certain aspects are customized for the type of component. Again, there can be only one type of component at a time.The problem that I am facing is that I will have different components for different row/column of the same table. So how do I implement some of the methods (for example, getCellEditorValue()), when I have multiple editor components?
    Also, how do I commit changes made by the user?
    I am extremely confused.
    Someone please help!
    Thanks.

    Actually, that's what I am currently doing.
    Here is my cell editor class:
    public class ObjectPropertyEditor extends DefaultCellEditor
           public ObjectPropertyEditor()
              super(new JTextField());
              Vector list = new Vector();
              list.add("Yes");
              list.add("No");
             myCombo = new JComboBox(list);
          public Component getTableCellEditorComponent(JTable table, Object value,
              boolean isSelected, int row, int column)
             String colName = (String)table.getValueAt(row,0);
             if(colName.equalsIgnoreCase("Leaf-Node?")) //if it is the "Leaf" property, return the combo box as the editor
                 return myCombo;
            else  //for all other properties, use JTextField of the super class
                return super.getTableCellEditorComponent(table,value,isSelected,row,column);
        private JComboBox myCombo;
    }The problem I have is that when I select a new item from the combo box, the new selection is not reflected in the tableModel. I don't know how I can achive that. I think I need the functionalities that DefaultCellEditor gives to its delegate when its constructor arguments is a combo box. But how can I get two different sets of functionalities (JTextField and JComboBox) ?
    Please help!
    Thanks.

  • How to Start a color in the middle of a cell in the table & end in next cel

    Hai,
    I am developing a project in VB6 and the databse in MsAccess, i prepared the Report in HTML, Based on 2 Fields called Nextti & Duration Field I am coloring the Background of cells in the report table.
    Actually the Color should start and end insdie or outside the cell based on the 2 Field Values.
    Table is populated for 4 Years under that 48 months, therefor 2 row headings. 1 for showing Years in column & other for Months & with Some fields.
    the below is the line i use to change the background of a particular cell. Its done when i populate the data in the HTML Report.
    OutStream.WriteLine ("<td bgcolor=Yellow><P align=center><Font FACE=Tahoma size=1 color=black>" & Format(dtShade, "dd") & "</Font></P></td>")
    Now i am able to shade the Cell by giving its background color to yellow as below code
    but the problem is i am able to change the background of the full cell. But i don't need to change the background of the full cell always. For example if Nextti value is 15/1/2005 & Duration is 30 then the shade should start from the middle of January Cell (because of the date 15th)end in the middle of next cell (February). If the duration is 15 then it should end in the (January) same end of cell. Kindly tell me how can i do this through HTML. I heard Div can be used to solve this issue. I am a beginner so kindly any one give me a appropriate example which will suit to solve this issue.
    thankyou,
    Chock.

    Can you work out what the actual HTML is to do
    "Whatever it was that you wanted to do" ? { I couldn't understand that }
    I.e If you make up a Test table, with Your Text editor can you get a sample output that looks like you want?
    But the problem is i am able to change the background of the full cell. But i don't need to change the background of the full cell always. For example if Nextti value is 15/1/2005 & Duration is 30 then the shade should start from the middle of January Cell (because of the date 15th)end in the middle of next cell (February). If the duration is 15 then it should end in the (January) same end of cell.
    Is this something that can be done in HTML?
    If your question is 'amenable' to HTML, figure out conditions for which you want to Set a certain color....
    If the color in one cell for instance depends on the Next Cell, then you're going to have to buffer the whole Table ROW....
    Set which ones should be RED for instance, then output that ROW in HTML...
    If you are using Java for this, then also be aware that you might need to escape certain characters like use "\\" to get "\"
    You'd also probaly have an easier time, however you are doing this if you used some sort of CSS .......

  • Activate only one cell in the table column

    Hi experts,
      I am facing a problem where in i need to allow only one cell for input in the complete table.
      Suppose i have 4 rows and 5 columns, and i want to allow only one field for input in the complete table based on a condition.
    Can someone help me how to achieve this?
    Regards,
    Madhu

    hi madhu,
           what you ca do is, have an extra attribute  in the node that is bound o the table, this attribute must be bound to the read only property of the cell. so according to your condition fill the attribute with 'X' or no value so that it will be in read only or editable mode.
    ---regards,
       alex b justin

  • How to disable perticluar cell of the table on the screen,at run time?

    HI All,
    I am using table control on the screen.
    I have 5 field in the table control.
    out of which one is posnr.
    Now, if user doesnt enters the value of posnr then it should be created automatically.
    I have written the code for that ,but this perticlar cell (for which posnr is generated automatically ) should be disabled now.
    Can anybody tell me how can i do it?
    Thnx in advance.

    Hello Sanjay,
      Write a module inside the loop...endloop in the PBO of your screen. Inside the module, check the field and disable it by modifying the SCREEN table.
    loop at itab with control tctrl.
      module modify screen.
    endloop.
    module modify_screen output.
      loop at screen.
       if screen-name cs 'POSNR'.
       if itab-posnr is not initial.
         screen-input = 0.
       else.
         screen-input = 1.
       endif.
       modify screen.
       endif.
      endloop.
    endmodule.
    Regards,
    Manoj

  • Tooltips for individual JCombo items

    I am currently trying to extend a JCombo used for searches in a database to also contain Tooltips (fetched from Database just like the JCombo items).
    if(wipbinData!=null)
    for(int i=0;i<wipbinData.length;i++)
    directCRcombobox.addItem(wipbinData[0]);
    directCRcombobox.setToolTipText(wipbinData[i][1]); //here I need not to make tooltip work only on JCombo in general but on specific ceels.
    All tips on getting tooltips on single items in the combobox would be appreciated.

    I tried to look at solving the extra information need with the tooltips. But as that turned out to be too tricky I instead added the extra information after the main info in the combobox. Then I fixed my query by using stringtokenizer to get only the first text for the query.
    But thanks for the answer anyway

  • How can i have the ToolTip set to rows of the table?

    hi,
    I have a Dialog window that diaplays a table contating the information like student name, student id, student address etc. But the problem what i am facing now is i want ToolTip to be set to this table. i.e, when i move the cursor over this table, ToolTip must be set to the student name of the perticular Row to which the mouse is pointing.
    I don't select the Row... but just move cursor over the table.
    How can i achieve this?
    Urgent Please....
    Thanx in advance,
    -Soni.

    probably best to add a mousemotionlistener to the table and by probing the generated mousevent (get the location of the mouse) on moving the mouse you can change either the tooltiptext or popup your own popup menu.

  • How do you format cell size in numbers for multiple cells at the same time?

    How do you format the cell size of multiple cells at once in numbers?

    select the cells you want to format by clicking at the top-left most cell, then shift click the bottom-right most cell.
    Then open the inspector by selecting the menu item "View > Show Inspector", then click the table inspector segment:
    now use the row height and column width fields to adjust as needed.
    You can also select multiple rows and columns by clicking in an active tables row/column header, then dragging to select rows (or column), then hover the cursor on the line the separates rows (or columns) until the cursor changes to a bar with arrows, then click, hold, and drag as needed.

Maybe you are looking for

  • Problem in compiling JSP page in OC4J 10.1.3.0.0

    Dear all, I started the ocj4 container that came with Jdeveloper. After starting the ocj4 server, I try to test it with the Servlet and JSP example. The Servlet Example work fine but I encounter the following error when I run the JSP example. 2006-01

  • InDesign CC interactive forms - PDF is blank when printed from any printer

    Hello - I have created an interactive PDF form in InDesign CC, which appears to work perfectly. However, I cannot get it to print. It shows the information on the page in the print preview, but the page is completely blank when it prints to a printer

  • Max number of buffers

    For fast image grabbing I wand to store images in the memory of the PC. To do this I use LL ring buffering. The max number of buffers is limited by Labview to 50. I tried to increase this by MAX >>Tools >> IMAQ (like suggested on the site) but Labvie

  • RAM allocation limit per process/ user

    Hi All, my wife is using a MacPro with 2Gb RAM at work to run a bioinformatics terminal application (mcl) and it seems she doesn't have enough RAM for the dataset she is trying to analyze. So here is my question(s): Since this machine has a 64bit CPU

  • Quicktime Conversion to Windows Media

    Hi, I just finiz editing a 8 minutes movie. When i try to export it using Quicktime Conversion to _Windows Media_, the exported file is only 30 seconds long. I'm puzzled. Anyone knows why? If i export to Quicktime directly, it is ok. However, when i