Tooltip for a particular cell in a Jtable

Hi all
I want to put a tooltip only for the cell (0,0) in my JTable.can anyone send the piece of code through which i can do it.Also i want to make this cell non-editable after or before giving the tool tip
Prasad

Look here
/Patrick

Similar Messages

  • Comment for a particular cell in the report using WAD

    Can some one help me how to write the comment for a particular cell using WAD which will be published on to the portal

    Hi Pavan,
    In order to modify particular cells in WAD you would need to use the table interface. Refer to this document:
    https://websmp104.sap-ag.de/~sapdownload/011000358700000305572005E/HowToTableInterface.pdf
    Hope it helps,
    Regards,
    Nikhil

  • Method for colouring particular cell

    Hello friends,
                 I displayed the output in grid using the class "CL_GUI_ALV_GRID".
    Now i need to colour the particular cell with different colours based on the condition.What is the method used for that. If possible give an example code.
    Thanks in advance.

    Hello Siva
    All details can be found in the excellent tutorial
    <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e8a1d690-0201-0010-b7ad-d9719a415907">An Easy Reference For ALV Grid Control</a>
    -> see pages 28+
    Briefly, here is the crucial coding part:
    *--- Internal table holding list data
    DATA BEGIN OF gt_list OCCURS 0 .
    INCLUDE STRUCTURE SFLIGHT .
    DATA rowcolor(4) TYPE c .
    DATA cellcolors TYPE lvc_t_scol .
    DATA END OF gt_list .
    DATA ls_cellcolor TYPE lvc_s_scol .
    READ TABLE gt_list INDEX 5 .
    ls_cellcolor-fname = 'SEATSOCC' .
    ls_cellcolor-color-col = '7' .
    ls_cellcolor-color-int = '1' .
    APPEND ls_cellcolor TO gt_list-cellcolors .
    MODIFY gt_list INDEX 5 .
    Regards
      Uwe

  • Tooltip for datagrid's cells

    I know how to create a tooltip for datagrid and/or its
    columns. Is it possible to create a tooltip (or something similar)
    for each cell? So whenever the mouse is over a certain cell, a tip
    would be shown for that cell that depends on the value of the cell.
    Similar functionality can often be seen in web-based database apps:
    an Ajax query gets related data from a database on mouseOver.
    My need and idea is to
    - show a simple text list as a tooltip
    - the text would be fetched from a database via a web service
    - the fetch would be based on datagrid's (hidden) rowid and
    each column's (hidden) column id (which are real database columns)
    - the database structure is an n:m relation i.e. one
    rowid+colid can refer to several items that are then used in the
    tooltip
    Use case: A number is displayed in the datagrid. The need is
    to display 0-n references related to that specific figure (e.g.
    book names, notes etc) in the tooltip. Next cell's tooltip would be
    showing different references.
    Anybody any ideas or suggestions? Thanks!

    Hi,
    Did you try creating a custom itemRenderer and handling the
    mouse events for that item renderer component. There is also a
    property called dataTipFunction, please check that too.
    Hope this helps.

  • Ask for suggestion: merge cell or multiple jtable

    I would like to have a jtable like this:
    +----------+------+------+------+-----+
    | 1.Item no|2.Desc|3.Type|4.Size|5.Qty|
    +----------+------+------+------+-----+
    |    001   |  ... |  A1  |  3   |  5  |
    |          |      |------|------|-----|
    |          |      |  A2  |  2   |  6  |
    +----------+------+------+------+-----+
    |    002   |  ... |  A1  |  4   |  4  |
    |          |      |------|------|-----|
    |          |      |  A3  |  2   |  6  |
    +----------+------+------+------+-----+For each item, it would have say, 2 types (2 rows beginning from the third column).
    The question is, I'm now considering whether 1)i should use multiple jtables, one from column 1 -2 and the other from column 3 to 5. OR 2)merge cells
    In fact, i just have thought of this 2 methods and not yet implemented them yet. Any suggestion?
    Many thanks,
    Pippen

    Thanks thahn2 but I 've tried out the examples before and found them not so useful for me. And some of them even have problems running on jdk1.4.
    Any suggestion on either choice will be welcomed. (or even other suggestions)

  • Tooltip for single ALV cell

    Hi,
    is it possible to add a tooltip (text appearing when mouse is moved over) to a single cell in an ALV grid created with FUNCTION 'REUSE_ALV_GRID_DISPLAY'?
    Please restrict your answers to the question, thank you.
    Regards,
    Clemens

    Hi,
    Tool tips are possible only at Column heading level unless you declare your column as a exception column / ICON / SYMBOL columns.
    Regards,
    Ravi
    Note :Please mark the helpful answers
    Message was edited by: Ravikumar Allampallam

  • How to apply hyper link for a particular cell in the column?

    Year
    2001
    2002
    2003
    2004
    I wanna apply Hyper link for 2001 only! How to achieve this?
    Can we apply no. of hyper links for a column?

    You have to create a conditional variable.
    For eg. create a variable with hyperlink in the syntax for Year.
    Now if else logic, so if YEAR=2001, return hyperlink else YEAR object.
    Hope you understood.
    Thanks
    Gaurav

  • Set focus on particular cell in a JTable when using TableModel.

    I want to implement validation in my table cells. I the value does not satisfy certain condition then the focus should remain on the same cell and the user should be asked to enter valid value.
    I am using TableModel and i have tried implementing validation in the setValueAt() method some thing like this.
    setValueAt method of my table model.
    public void setValueAt(Object value, int row, int col){
    if(datalist.size()>row){
    OutboundFieldMappingObj obj=(OutboundFieldMappingObj)datalist.get(row);
    String str=null;
    switch (col){
    case 0:
    str=Validator.getValidNumber((String)value,1,999999999L);
    obj.setFiledName(str);
    break;
    case 1:
    str=Validator.getValidString((String)value,128,false);
    obj.setFiledClass(str);
    break;
    case 2:
    obj.setSource((String)value);
    break;
    fireTableCellUpdated(row, col);
    But this doesn't solve the issue. In this case after entering the value when i click on some other cell then it shows me a message stating that the value is invalid but it doesn't takes the focus back to same cell. The focus is shifted to the cell where i have clicked.
    Please help me out in resolving the issue.
    I have added the code of my validator class at the bottom if any one needs to have a look at it.
    Thanks
    Validator class
    public class Validator {
    public Validator() {
    public static String getValidString(String val, int max, boolean upper) {
    if (val == null || val.equals("")) {
    showErrorMsg("The cell can not be left blank");
    return " ";
    if (val.length() > max) {
    val = val.substring(0, max);
    showErrorMsg("String value to long. Truncated to " + max +" characters.");
    if (upper) {
    val = val.toUpperCase();
    return val;
    public static String getValidNullableString(String val, int max, boolean upper) {
    if (val == null) {
    return null;
    if (val.length() > max) {
    val = val.substring(0, max);
    showErrorMsg("String value to long. Truncated to " + max +" characters.");
    if (upper) {
    val = val.toUpperCase();
    return val;
    public static String getValidNumber(String number, int min, long max) {
    try {
    long num = Long.parseLong(number);
    if (num < min) {
    showErrorMsg("Number less than mininum value of " + min + ".");
    return "" + min;
    if (num > max) {
    showErrorMsg("Number greater than maximum value of " + max +".");
    return "" + max;
    return number;
    } catch (Exception x) {
    showErrorMsg("Invalid Entry. Number Expected.");
    return "0";
    // return "";
    public static boolean getValidNumber(String number) {
    try {
    Integer.parseInt(number);
    return true;
    } catch (Exception x) {
    showErrorMsg("Invalid Entry. Number Expected.");
    return false;
    // return "";
    public static void showErrorMsg(String message) {
    JOptionPane.showMessageDialog(new java.awt.Frame(), message,
    "Invalid Value!",
    JOptionPane.ERROR_MESSAGE);
    public static boolean validString(String str) {
    if (str != null && str.length() > 0) {
    return true;
    return false;
    }

    You need to create a custom editor. Something like this:
    http://forums.sun.com/thread.jspa?forumID=57&threadID=642364
    If you need further help then you need to create a [Short, Self Contained, Compilable and Executable, Example Program (SSCCE)|http://homepage1.nifty.com/algafield/sscce.html], that demonstrates the incorrect behaviour.
    Don't forget to use the Code Formatting Tags so the posted code retains its original formatting. That is done by selecting the code and then clicking on the "Code" button above the question input area.

  • Cell tooltip for ALV

    Hello experts,
    I am new to ALV development. I have created an ALV grid report which displays data fetching from DDIC tables.
    I want to display tooltip for each individual cell of the ALV, I know about using field category property SELTEXT_M but its used for entire column tooltip. My requirement is to display tooltip for individual cell in the grid.
    Please provide me simple explanation to use tooltip for cell in ALV.
    Simple example code would be appreciated.
    Thanks in advance.
    Regards,
    Viral Patel

    Hi,
    If you are using OOPS ALV then, there is a field available in the field catalogue : TOOLTIP which you can use to display the tooltip for the column header.
    try this:
    wa_fcat-TOOLTIP = '-tooltip--'.
    I hope it helps you.
    Thanks & Regards,
    Radhika

  • How do I change the colour of a selected cell in a jTable?

    I have a Jtable that displays URL names in one column. There are several problems I'm having. The effect I'm trying to achieve is this:
    When the user runs the mouse over the URL name the cursor should change into a hand (similar to what happens in an HTML hyperlink). I'm aware that the Cursor class can set the cursor graphic so i figure that i need a listener of some sort on each cell (so the cursor can change from an arrow to a hand) and also one to indicate when the cursor is not on a cell (so that it can change from a hand back into an arrow). Is this the right track?
    Also, I've looked at the DefaultTableCellRenderer class (which, as i understand it, is responsible for how each cell in the jtable is displayed) for a method that will allow me to set the background of a selected cell (or row or column). I require this because each time i select a cell (or row) it becomes highlighted in blue. I would rather it just remained white and changed the cursor to a hand. I know there exists a method for setting the background for an unselected cell but none for a selected cell. Again, I'm not sure if I'm going down the right track with this approach.
    Lastly, if the cell has been selected (by a mouse click) the font of the writing in the cell (i.e. The name of the URL) should change. This shouldn't be too much of a problem I think.
    I do not expect anyone to provide code to do all of this but some general pointers would be extremely helpful as I do not know if I'm thinking on the right track for any of this. Having some (limited) experience with Swing I doubt there is a simple way to do this but I can only hope!
    Thanks.
    Chris

    http://www2.gol.com/users/tame/swing/examples/SwingExamples.html
    there you can find some examples with CellRenderer's and so on ...
    have fun

  • Help with editing a cell in a JTable. DESPERATE

    Hi! Is there someone out there that could help with some source code for editing a cell in my JTable when I run it as an applet??
    It works fine when I run it as an application.
    I manage to select the row and write a number in it, but I can't get out of the cell (it seems that the program stops??). I want to enter an integer in a cell and when I click enter or with the mouse in an other cell the value that I enter should update some other cell( multiply the entered value with some fixed number and update a cell in a second coloumn)
    I am really desperate now..... I have thought about using a MouseListener....
    I am using a tablemodel that is from AbstractTableModel.

    Are you using some cell editors?
    While converting inside them, you might be getting some exceptions (like parseexception)which is stopping you from proceeding further.
    Are you using your own tablemodel with custom datatypes?
    Hope this helps,
    Ramkumar

  • 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.

  • Need to enable particular cells in ouput

    Hi,
    I need to set the 'read only ' property for a particular cell ( Not the entire row ) in the normal table node ( not ALV ) based on condition.
    --Ramakrishna

    Hi,
    Cehck for Batch config:-
    http://help.sap.com/bp_bblibrary/500/html/T04_EN_ZH.htm
    http://www.sap-img.com/materials/config-setting-in-batch-management.htm
    Now updated the MMR in Purchasing view Batch Management.
    Bathc flow:-
    http://www.sap-img.com/mm030.htm
    http://help.sap.com/printdocu/core/Print46c/en/data/pdf/LOBM/LOBM.pdf
    pherasath

  • Keypressed event for a particular  edited cell of jtable

    hi friend,
    how to write the key pressed event for the edited cell of jtable which having focus on that particular cell.
    pls help me out.

    [http://catb.org/~esr/faqs/smart-questions.html]
    [http://mindprod.com/jgloss/sscce.html]
    db

  • How to insert checkbox at a particular  cell  in jtable

    hello,
    I am a user of jdeveloper using jclient/swing .
    question:
    i am using jtable. i want that whenever i click on a specified cell then text at that particular cell get clear and a checkbox inserted in that cell . whenever i click on that checkbox i.e check the checkbox,
    again a text is inserted in that cell.
    thank you

    Did you ever get this to work? If I bind a JCheckbox to my attribute and add the checkbox to my JClient panel, the attribute value is properly bound to the checkbox with everything working correctly. Adding the checkbox as the TableCellEditor for the column doesn't work.
    Also, the link to using a Combobox as a table cell editor works, but the link doesn't tell where to donwload the sample code from. Doesn't anyone know the link?

Maybe you are looking for

  • Weather magnet PAR File Export Error

    I have created a weather application PAR File following this blog:  Create a weather magnet  using xml feed from weather.com As far as I can tell I have followed everything correctly however when I select Export to create the file I get the following

  • New MacMini that wants to iChat AV

    Just bot my family Macs and they all have built in cameras except for the MacMini I bot for my 8 year old. He loves it. I want to video chat with him and the reast of my fam while I am traveling on business. I bot a USB WebCam called iMage from Pico

  • Can I use my car stereo connected to my iPhone when I have it an Apple watch connected?

    Can I use my car stereo connected to my iPhone when I have it an Apple watch connected? In short, I want my phone to connect to my car audio when I'm driving rather than my Apple watch.

  • New Air Port Time Capsule Not Working With Old Airport Express

    I have been running a home network comprised of a Air Port Time Capsule (A1254) and 5 ea Air Port Express (A1264) for several years with no problem. The Air Port Time Capsule (A1254) died and I replaced it with an Air Port Time (A1470). Now none of t

  • Change Business System

    Hi Experts, We have a Business System (SAP ECC) Bus_A pointing to SAP_A. So all my present objects (channels, Interface Determination, Receiver Determinations, and Agreements) refer to Bus_A in the Sender/ Receiver section. Now there is a requirement