: How to make a cell editable and uneditable in a JTable

i have created a table and want to make some modifications in the cells and also make it uneditable...i hace used abstract table model . kindly guide me

You have got to implement the 'isCellEditable' method within your abstract table model. If you want to allow the user to only edit cells in the first column you would add the following:
public boolean isCellEditable (int row, int col) {
  if ( col == 0 ) {
    return true
  } else {
    return false;
}That should be sufficent to base your own needs off.
Jon

Similar Messages

  • How to make an checkbox editable and uneditable within a single alv output.

    Hi,
    How to make an checkbox editable and uneditable within a single alv output depending on condition.
    I have used Reuse_alv_grid_display.
    In my output every checkbox is editable. i have used edit = 'X'.
    I want editable checkbox for correct value and uneditable checkbox for incorrect value in a single alv

    >
    Mukilansap wrote:
    > I want editable checkbox for correct value and uneditable checkbox for incorrect value in a single alv
    Use alv styles to achieve this, set the style for each record before displaying the ALV. Structure LVC_S_STYL.
    Take a look at the example BCALV_EDIT_02, it is OOPS based, but check how the style table is filled.
    regards,
    Advait

  • How to make a pdf editable and save for print

    Hi,
    I just joined Adobe Cloud and it's been a while since I have used acrobat. I have made a brochure that I need a couple of things to be editable on. See below. I need the two areas highlighted in red to be editable for different locales/people. My questions are:
    A) I assume Acrobat is the way to do this. I also have FormsCentral if that works better. Can someone tell me how to make these two fields editable?
    B) What program do they edit with?  Acrobat Reader?
    C) How do they save and output it for print?
    Thank you,
    John

    This is not about what Acrobat can or can't do - and you just said they won't have it anyway. It's about the limitations of PDF. A proper solution is to develop (at some expense) a server side PDF generator that takes the user's input and makes them a custom PDF. I don't know if you can just subscribe to a service to do this. If you aren't going to have them use Acrobat, form fields are your only option. Be sure they (and you) understand the limitations and that they must use Reader (not one of the many other PDF viewers). Be sure you understand about reader enabling: many versions of Reader CANNOT SAVE filled in files unless they are specially prepared.
    So back to your original question: how do you make the fields editable: with the Forms function in Acrobat. You may have better luck in the Acrobat Forms forum.

  • How to make ALV cell editable

    Hi ,
    I am using cl_gui_alv_grid .
    please let me know how to make a particular cell is editable
    eg:  cell corresponding to first row second column should be editabel but remaining all are non editable

    Hi,
    Loop at your internal table.
    Eg: i have total 5 fields in my internal table itab_zqmeinz. in that 3 fields are editable as below.
    declare DATA: lt_celltab TYPE lvc_t_styl.
    internal table with celltab as one of the column
    DATA: BEGIN OF itab_zqmeinz OCCURS 0. "TYPE STANDARD TABLE OF zqmseqkopf
            INCLUDE STRUCTURE zqmseqeinz.
    DATA: celltab TYPE lvc_t_styl.
    DATA: END OF itab_zqmeinz.
    LOOP AT itab_zqmeinz INTO wa_zqmeinz.
          l_index = sy-tabix.
          REFRESH lt_celltab.
          CLEAR wa_zqmeinz-celltab.
          PERFORM fill_celltab1 USING 'RW'
                                  CHANGING lt_celltab.
          INSERT LINES OF lt_celltab INTO TABLE wa_zqmeinz-celltab.
          MODIFY  itab_zqmeinz FROM wa_zqmeinz INDEX l_index.
        ENDLOOP.
    FORM fill_celltab1 USING value(p_mode)
                      CHANGING pt_celltab TYPE lvc_t_styl.
    Refresh pt_celltab.
      clear ls_celltab.
      IF p_mode EQ 'RW'.
        l_mode = cl_gui_alv_grid=>mc_style_enabled.    "to enable the required fields
      ELSE.                                "p_mode eq 'RO'
        l_mode = cl_gui_alv_grid=>mc_style_disabled.
      ENDIF.
      ls_celltab-fieldname = 'NEBENSEQUEN'.   " field1
      ls_celltab-style = l_mode.
      INSERT ls_celltab INTO TABLE pt_celltab.
      ls_celltab-fieldname = 'BEZEICHNUNG'.     "field2
      ls_celltab-style = l_mode.
      INSERT ls_celltab INTO TABLE pt_celltab.
      ls_celltab-fieldname = 'SORTIERUNG'.         "field3
      ls_celltab-style = l_mode.
      INSERT ls_celltab INTO TABLE pt_celltab.
    Endform.
    It works. I have done it in my program.
    Thanks,

  • How to make table as "editable false"

    Dear Forum,
    i am user of jDeveloper jClient/Swing .jpr.
    cutomer table having following attributes-
    1.cust_id (primary key)
    2.cust_name
    3.cust_add
    Suppose customerview bind with jTable1.
    Using ViewObjectEditor, i set "updateable never" for all fields.
    This show error, when data insert into table " cust_id as
    read only".
    Help me, Using jClient Binding how to make Table as "editable false".

    Overriding method prepareEditor() for new table:
    private JTable tableList = new JTable(){
    public Component prepareEditor(TableCellEditor editor, int row, int column) {
    // 1 and 2 column is not editable
    if(column == 0 || column == 1){ return null; }
    return super.prepareEditor(editor, row, column);

  • How to make field is editable in ALV  CL_SALV_TABLE only)

    Hi,
    How to make field is editable in ALV  CL_SALV_TABLE only)
    Any one has tried to make field si editable by using CL_SALV_TABLE class.
    *I know how to do it in REUSEALV function module and CL_GUI_ALV class.*_
    Please reply only if you riedin CL_SALV_TABLE class method.
    Regards
    Rajesh V
    Moderator message: not supported, please read class documentation and search for previous discussions.
    Edited by: Thomas Zloch on Mar 17, 2011 2:07 PM

    Hi Chad,
    Please refer the link,
    Edit field in alv
    Regards,
    Hema.
    Reward points if it is useful.

  • How to make Date fields Editable or Non-Editable based on Call Staus

    Hi,
    We are using CRM2007 Web GUI for Service call creation. We are using date profile to populate the dates. Here my requirement is if call status is 'Call created' then some set of date fields to be appeared in display mode(Non Editable) and some set of date fields to be appeared in change mode(Editable). How to achieve this. Kindly suggest me.
    Regards,
    Steve

    Hello,
    Kindly check the following thread which is giving many solutions for your requirement:
    Re: how to make field non-editable (display mode)
    Kind regards,
    Nicolas Busson.

  • How to make google come up and not yahoo when i click anew tab

    how to make google come up and not yahoo when i click a new tab
    == This happened ==
    Every time Firefox opened
    == today

    You can use 1 of these add-ons
    [https://addons.mozilla.org/en-us/firefox/addon/newtaburl/?src=search
    NewTabURL ]
    [https://addons.mozilla.org/en-us/firefox/addon/new-tab-homepage/?src=search New Tab Homepage]
    with NewTabUrl you have more options
    thank you
    Please mark "Solved" the answer that really solve the problem, to help others with a similar problem.

  • How to make table cell have certain width

    Hi
    i have 3 cells when i write text in any cell it effects the
    width of other cells !!!
    how to make every cell have certain? i mean i want to wrap
    the text not to effect the cell width
    thanks in advance.

    Hi Mac,
    Try this
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0
    Transitional//EN">
    <HTML><HEAD><TITLE>Home</TITLE>
    <META http-equiv=Content-Type content="text/html;
    charset=iso-8859-1">
    <style>
    .text-content-green {
    FONT-SIZE: 11px;
    COLOR: #a5a834;
    LINE-HEIGHT: 20px;
    FONT-STYLE: normal;
    FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif;
    TEXT-DECORATION: none;
    .text-content-green:hover {
    FONT-SIZE: 11px;
    COLOR: #AE0B0B;
    LINE-HEIGHT: 20px;
    FONT-STYLE: normal;
    FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif;
    TEXT-DECORATION:underline;
    .margin {
    margin: 1px 1px 1px 1px;
    border-style: solid;
    border-top-width: 1px;
    border-left-width: 1px;
    border-right-width: 1px;
    border-bottom-width: 1px;
    border-color: gainsboro;
    </style
    </HEAD>
    <BODY topmargin="10px" leftmargin="0" rightmargin="0"
    class="body-style">
    <TABLE width="729" border="0" cellpadding="0"
    cellspacing="0" cellsadding="0" align="center" class="margin">
    <TBODY>
    <TR>
    <TD width="125" valign="top" bgcolor="#f0f0c1">
    <table width="125" border="0" cellspacing="0"
    cellpadding="0">
    <tr>
    <td width="25" height="25" align="middle"></td>
    <td width="108" class="text-content-green"><A
    class="text-content-green" href="default.html">LEFT
    NAV</A></td>
    </tr>
    <tr>
    <td colspan="2" align="middle"></td>
    </tr>
    <tr>
    <td width="25" height="25" align="middle"></td>
    <td width="108" class="text-content-green"></td>
    </tr>
    <tr>
    <td colspan="2"></td>
    </tr>
    </table>
    </TD>
    <TD vAlign=top width=539 bgColor="white" height=471>
    <P class="text-content-green" align=left
    style="padding-left:5px">Lorem ipsum dolor sit amet, consectetur
    adipisicing elit.Duis aute irure dolor in reprehenderit in
    voluptate velit esse cillum .
    </P>
    </TD>
    </TR>
    </TBODY>
    </TABLE>
    </TD>
    </TR>
    </TBODY>
    </TABLE>
    </BODY>
    </HTML>
    HTH
    Shanthi

  • Adobe Captivate 7 Project How to make Rollover cations, audio, and video work in HTML format?

    Adobe Captivate 7 Project How to make Rollover cations, audio, and video work in HTML format?

    Honestly, I don't even know why this is an option. The conversion to Flash is completely unusable.
    I have exported some things to Flash, and since I program in Flash all the time I was able to manipulate to work to some degree. Most text captions are built with multiple elements and completely fall apart.
    Sorry, I can't be of more help.

  • How to make images fade in and out

    how to make images fade in and out continuously

    HI,
    The Ken Burns effects can do this nicely. Available in the iLife suite of software.
    iLife 06 minimum requirements:
    http://support.apple.com/kb/HT2675
    iLife 06 - Amazon
    Carolyn

  • When you change PC how to make connection with iphone and new PC

    when you change PC how to make connection with iphone and new PC

    Yes, you can do it the same as any other database. The code would be similar.
    I'd also suggest you not to use the JDBC ODBC bridge for connection. There are other drivers available for that.
    Regards
    xH4x0r

  • How to make custom binary module and add to powershell?

    How to make custom binary module and add to powershell?
    I wish to add 'Microsoft.SharePoint.Client.dll' in powershell as binary module so I can use its intellisense.

    Hi Biraj,
    I replied to this in other thread
    https://social.technet.microsoft.com/Forums/en-US/a13c9cc8-7d53-46b5-b5bb-65404db2d347/how-to-make-intellisense-enable-in-powershell-in-csom-for-sharepoint-online?forum=sharepointdevelopment
    Kind Regards,
    John Naguib
    Senior Consultant
    John Naguib Blog
    John Naguib Twitter
    Please remember to mark this as answered if it helped you

  • How to make a cell in a JTable to be uneditable and handle events

    I tried many things but failed,How do you make a cell in a JTable to be uneditable and also be able to handle events>Anyone who knows this please help.Thanx

    Hello Klaas2001
    You can add KeyListener ,MouseListener
    Suppose you have set the value of cell using setValueAt()
    table.addKeyListener(this);
    public void keyTyped(KeyEvent src)
    String val="";
    int r= table.getEditingRow();
    int c= table.getEditingColumn();
    val=table.getValueAt(r,c).toString();
    if (r!=-1 && c!=-1)
    TableCellEditor tableCellEditor = table.getCellEditor(r, c);
    tableCellEditor.stopCellEditing();
    table.clearSelection();
    table.setValueAt(val,r,c);
    public void keyReleased(KeyEvent src)
    public void keyPressed(KeyEvent src)
    table.addMouseListener(this);
    public void mouseClicked(MouseEvent e)
    public void mouseEntered(MouseEvent e)
    public void mouseExited(MouseEvent e)
    public void mousePressed(MouseEvent e)
    public void mouseReleased(MouseEvent e)
    if(e.getClickCount()>=2)//Double Click
    table.clearSelection();
    int r= table.getEditingRow();
    int c= table.getEditingColumn();
    if (r!=-1 && c!=-1)
    TableCellEditor tableCellEditor = table.getCellEditor (
    r,c);
    tableCellEditor.stopCellEditing();
    table.clearSelection();
    table.setValueAt("",r,c);
    }//Mouse Released
    You can remove keyListener and Mouse Listener whenever You want to edit
    then add it later.
    Regarding handling events implement javax.swing.event.TableModelListener
    table.getModel().addTableModelListener(this);
    public void tableChanged(javax.swing.event.TableModelEvent source)
    TableModel tabMod = (TableModel)source.getSource();
         switch (source.getType())
    case TableModelEvent.UPDATE:
         break;
         }//Table Changed Method
    //This method gets fired after table cell value is changed.

  • How to make a particular row and column field editable in ALV

    Hi Experts,
    I have a requirement to make a particular row and column field editable in ALV output. Like i need to make 2nd row - 4th column editable of ALV output.
    Kindly help me out to solve this.
    Any help would be appreciated.
    Thanks,
    Ashutosh

    Hi Ashutosh,
    please check below, explained by some experts.
    In the below link  editing two columns MOD_RANK and TECH_RANK.
    These two columns will be in edit mode once after selecting the required record
    Editing single cell in a row of ALV table
    And also look for more info
    http://scn.sap.com/thread/884976

Maybe you are looking for

  • How to create an IDoc just with the updated data.

    Hello I have a question regarding IDocs. In case I updated an existing material. Is there a transaction where I can put a matnr in, that reads the change pointer table and creates an IDOC with just the updated fields for an existing material. Like th

  • Ps elements 10.

    I have  Ps elements 10. I have a new pc and want to download id but I can't find it . Where can I find E10 for download?

  • Can I upgrade my Xserve G5, 2.0Ghz machine with 1Tb drives, currently using 250Gb drives

    I need to replace one of the 250 gb raid drives on my Xserve G5 machine. 2.0 Ghz cpu. I would like to upgrade both drives but sales guy @ OWC not sure if this machine will support 1TB drives. Thanks for the help.

  • Lösung: Miniaturansichten von Photoshop im Explorer

    Wer keine Miniaturansichten unter Photoshop hat: Adobe hat und will keine Lösung - anyway. Ich habe mir verschiedene Systeme auf einem PC aufgesetzt und geforscht. Die Lösung ist eine kleine dll und 2 Registry-Einträge. Die dll heißt "psicon.dll" und

  • How do i troubleshoot sharing outside my home network?

    I have four Macs - iMac20, iMac27, Mac Mini and a MacBookPro. I have no trouble connecting and sharing data and screens between these machines when I'm at home on my home network, but when I'm at work and I want to connect from my MacBook Pro to my M