How to disable/enable the cells for editing column wise in JTable in java?

Hi All,
Can any one tell me how to disable the cells for editing by column wise in JTable?
Here depending upon the radio button selected, I need 2 disable some columns for editing
and enable some columns for editing?
how can I do tat using JAVA?
Any sample code is of great help to me.
Thanks in Advance

http://java.sun.com/docs/books/tutorial/uiswing/components/table.html
~

Similar Messages

  • How do I enable the security for my wireless connection?

    How do I enable the security for my wireless connection?

    Enter the setup page (192.168.1.1),  hit the Wireless Tab, then the Security tab.

  • How to get all the values in one column of a JTable

    How to get all the values in one column of a JTable as a Collection of String.
    I don;t want to write a for loop to say getValueAt(row, 1) eg for 2nd column.

    I don;t want to write a for loop to say getValueAt(row, 1) eg for 2nd column. You could always write a custom TableModel that stores the data in the format you want it. It would probably be about 50 lines of code. Or you could write a loop in 3 lines of code. I'll let you decide which approach you want to take.

  • How do I enable the audio for text audiobooks?

    I have downloaded several  books (ipad3) that state they are Audio Edition  e.g. A Christmas Carol.  The book opens and I can read the text.  How do I enable the audio portion?
    I am able to listen to other books that are audio only without the text.
    Thank you.

    as always all i need is a good night sleep....zzzzzzzzzzzzz
    anyway that what did the trick for me:
    import flashx.textLayout.container.*;
    myTextLayout.verticalScrollPolicy = ScrollPolicy.AUTO;
    there is another option to add it in the XML file:
    verticalScrollPolicy="auto" horizontalScrollPolicy="auto"

  • How can i enable the trace for OpenDocument URL

    When i trying to view the document through OpenDocument URL getting an error message "An error occured. Error occured while trying to view the document". But when i verified throguh infoview/cmc able to view the report with out any error for the same user.
    I verified access level and the user have required access rights "view access, View Objects" etc..
    I enabled the trace for the servers "Crystal Processing Server, Crystal Cache Server, CMS server, Report Application Server", but i didn't see any useful information.
    I'm facing the issue with Crystal Reports and didn't try with WEBI reports.
    Is there any way to debug the issue and any path to enable the trace

    Hi RVS,
    I integrated BO to my application. When i tried to open the instance through my app using OpenDocument URL, it asking the login credentials (generally it should not). Once if i provide the credentials navigating to the error page.
    I'm using the BOXI 3.1 with SP6.
    Below are the url's captured when i tried to see the instance
    http://myserver.com:8080//PlatformServices/service/app/logon.do?appKind=InfoView&service=%2FOpenDocument%2FappService.do&backContext=%2FOpenDocument&backUrl=%2Fopendoc%2FopenDocument.jsp%3FbackContext%3D%252FCrystalReports%26SERVICE%3D%252FOpenDocument%252FappService.do%26backUrl%3D%252Fview.do%26service%3Dtimeout&backUrlParents=1&appName=Open+Document&prodName=Business+Objects+Enterprise&cmsVisible=false&cms=myserver%3A6400&authenticationVisible=false&authType=secEnterprise&sso=false&sm=true&smAuth=secLDAP&sapSSOPrimary=false&persistCookies=true&sessionCookie=true&useLogonToken=true
    http://myserver.com:8080//OpenDocument/appService.do?service=skinning&resource=stylesheet
    Thanks,
    Pradeep.

  • How can you use the Keyboard for a JComboBox within a JTable without F2

    I am brand new to Java and I can't seem to figure this out. I have a JTable with 4 columns. The first column is a jCheckBox which is working fine. The other three are JComboBoxes. They work fine when you click them and select from the list, but our end users only want to navigate with the keyboard. They want to be able to tab to the column and just start typing the first letter of the item that they want to choose from the list and have that pop up the list and scroll to the first item in the list that starts with the letter the typed. Does anyone know how to do this? I have been playing with this for a week now and I can't seem to make it work. Please help. Below is the code for my table. Any help would be appreciated greatly. Thanks,
    Lisa
         private void LoadSTCGTable(){
         //Connect to database
            try {
                    connection = ConnecttoDB.connect();
                    // Tell me why I couldn't connect
                } catch (ClassNotFoundException ex) {
                    ex.printStackTrace();
                } catch (SQLException ex) {
                    ex.printStackTrace();
         try {
                // Get listing of Squad Types
                tblSTCG.setModel(new javax.swing.table.DefaultTableModel(
                new Object [][] {
                    {new Boolean(false), null, null, null},
                new String [] {
                    "SELECT", "SQUAD TYPE", "SQUAD CLASS", "SQUAD GROUP"
              //Add Checkbox column
               tblSTCG.getColumnModel().getColumn(0).setCellEditor(tblSTCG.getDefaultEditor(Boolean.class));
               tblSTCG.getColumnModel().getColumn(0).setCellRenderer(tblSTCG.getDefaultRenderer(Boolean.class));      
               tblSTCG.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
               Whichquerytoread = 1;
               GetSql();
               sql = textfileinfo;
               stmt = connection.createStatement();
               rs = stmt.executeQuery(sql);
               md = rs.getMetaData();
               typelist = new ArrayList();
               // Loop Through Results
               typelist.add(new PairedDescriptionCodeDesc("",""));
               while (rs.next())
                  int i = 1;
                 typelist.add( new PairedDescriptionCodeDesc(rs.getString(2),rs.getString(1)));
              s1 = new TreeSet(typelist);
              typelist = new ArrayList(s1);
              AllTypeList = new PairedDescriptionCodeDesc[typelist.size()];
              for (int i = 0; i<typelist.size(); i++)
                 AllTypeList=(PairedDescriptionCodeDesc)typelist.get(i);
    rs.close();
    catch (SQLException ex) {
    ex.printStackTrace();
    Vector typedata = new Vector();
    for (int i=0;i<typelist.size();i++)
    typedata.addElement((PairedDescriptionCodeDesc)typelist.get(i));
    cmboType = new JComboBox();
    cmboType.setModel(new DefaultComboBoxModel(typedata));
    cmboType.putClientProperty("JComboBox.isTableCellEditor", Boolean.TRUE);
    cmboType = new JComboBox(AllTypeList);
    cmboType.setBorder(BorderFactory.createEmptyBorder());
    squadcol = tblSTCG.getColumnModel().getColumn(1);
    DefaultCellEditor cmboTypeEditor = new DefaultCellEditor(cmboType);
    cmboTypeEditor.addCellEditorListener(new NewRowCellEditorListener(tblSTCG));
    squadcol.setCellEditor(cmboTypeEditor);
    try {
    // Get listing of Squad Class
    Whichquerytoread = 2;
    GetSql();
    sql = textfileinfo;
    stmt = connection.createStatement();
    rs = stmt.executeQuery(sql);
    md = rs.getMetaData();
    classlist = new ArrayList();
    // Loop Through Results
    classlist.add(new PairedDescriptionCodeDesc("",""));
    while (rs.next())
    classlist.add(new PairedDescriptionCodeDesc(rs.getString(2),rs.getString(1)));
    s1 = new TreeSet(classlist);
    classlist = new ArrayList(s1);
    AllClassList = new PairedDescriptionCodeDesc[classlist.size()];
    for (int i = 1; i<classlist.size(); i++)
    AllClassList[i]=(PairedDescriptionCodeDesc)classlist.get(i);
    rs.close();
    catch (SQLException ex) {
    ex.printStackTrace();
    Vector classdata = new Vector();
    for (int i=0;i<classlist.size();i++)
    classdata.addElement((PairedDescriptionCodeDesc)classlist.get(i));
    cmboClass = new JComboBox();
    cmboClass.setModel(new DefaultComboBoxModel(classdata));
    cmboClass = new JComboBox(AllClassList);
    classcol = tblSTCG.getColumnModel().getColumn(2);
    DefaultCellEditor cmboClassEditor = new DefaultCellEditor(cmboClass);
    classcol.setCellEditor(new DefaultCellEditor(cmboClass));
    cmboClassEditor.addCellEditorListener(new NewRowCellEditorListener(tblSTCG));
    try {
    // Get listing of Squad Group
    Whichquerytoread = 3;
    GetSql();
    sql = textfileinfo;
    stmt = connection.createStatement();
    rs = stmt.executeQuery(sql);
    md = rs.getMetaData();
    grouplist = new ArrayList();
    // Loop Through Results
    grouplist.add(new PairedDescriptionCodeDesc("",""));
    while (rs.next())
    int i = 0;
    grouplist.add( new PairedDescriptionCodeDesc(rs.getString(2), rs.getString(1)));
    s1 = new TreeSet(grouplist);
    grouplist = new ArrayList(s1);
    AllGroupList = new PairedDescriptionCodeDesc[grouplist.size()];
    for (int i = 0; i<grouplist.size(); i++)
    AllGroupList[i]=(PairedDescriptionCodeDesc)grouplist.get(i);
    rs.close();
    catch (SQLException ex) {
    ex.printStackTrace();
    Vector groupdata = new Vector();
    for (int i=0;i<grouplist.size();i++)
    groupdata.addElement((PairedDescriptionCodeDesc)grouplist.get(i));
    cmboGroup = new JComboBox();
    cmboGroup.setModel(new DefaultComboBoxModel(groupdata));
    cmboGroup = new JComboBox(AllGroupList);
    groupcol = tblSTCG.getColumnModel().getColumn(3);
    DefaultCellEditor cmboEditor = new DefaultCellEditor(cmboGroup);
    cmboEditor.addCellEditorListener(new NewRowCellEditorListener(tblSTCG));
    groupcol.setCellEditor(cmboEditor);
    tblSTCG.setShowHorizontalLines(false);
    tblSTCG.setShowVerticalLines(false);
    TableColumnModel columnModel = tblSTCG.getColumnModel();
    TableColumn column;
    tblSTCG.getColumnModel().getColumn(0).setPreferredWidth(5);
    tblSTCG.getColumnModel().getColumn(1).setPreferredWidth(100);
    tblSTCG.getColumnModel().getColumn(2).setPreferredWidth(100);
    tblSTCG.getColumnModel().getColumn(3).setPreferredWidth(100);
    scpSTCG.setViewportView(tblSTCG);
    private class NewRowCellEditorListener implements CellEditorListener
    JTable editingTable;
    public NewRowCellEditorListener(JTable table)
    editingTable = table;
    public void editingStopped(ChangeEvent e)
    if(editingTable.getRowCount() == editingTable.getSelectedRow() + 1)
    ((DefaultTableModel)editingTable.getModel()).addRow(new Object [] {null, null, null, null});
    public void editingCanceled(ChangeEvent e)

    Final Cut Pro menu > Audio / Video Settings... (Cmd Opt Q) will show you al the various presets currently loaded
    Sequence menu > Settings... (Cmd Zero) will show you the current sequence's settings
    Edit > Item Properties > Format... (Cmd 9) will show you the selected clip's properties

  • How to disable/enable the export function?

    Hi,
    I created a customized form from template and tried to disable the export function in the menu(File->Export).
    How can i do for this?
    Thanks and best regards,
    Zhxiang.

    HI,
    If you are creating a e-business form from standard template and if your block is multi record block, then the Export option is automatically enabled.

  • How can I change the output for certain columns only?

    I am finding it hard to explain my issue , as I am very green when it comes to database, but I will try my best.
    I am writing a script that will query a database and output 5 columns, the first and last name of a student, the last name of their adviser, their enrollment status, and how many years they have been enrolled.
    I have the student's enrollment date and graduation date stored, however not all students have graduated, so that field is null for some students.
    my question is, how can I use their enrollment status of graduated to change the calculation of how long they were enrolled for.
    This is what I have so far :
    SELECT
         STUDENTS.NameFirstS,
         STUDENTS.NameLastS,
         STUDENTS.EnrollStatus,
         TRUNC((MONTHS_BETWEEN(SYSDATE, STUDENTS.EnrollDate))/12) as Years,
         FACULTY.NameLast
    FROM
         STUDENTS,
         FACULTY
    WHERE
         STUDENTS.ThesisAdvisor = FACULTY.FacultyId
    I'm not sure where to go form here, like I said, I am very new. Thank You in advance!

    Thank you for the warm welcome :)
    My Oracle Version is 11.2.0.1.0
    Here is the create statement I used for the table.
    CREATE TABLE STUDENTS
    (StudentId NUMBER(9)                                                             
    ,NameFirstS VARCHAR(255) NOT NULL                                             
    ,NameMiddleS VARCHAR(255)                                                       
    ,NameLastS VARCHAR(255) NOT NULL                                             
    ,PhoneHome NUMBER(10) NOT NULL                                                  
    ,PhoneOffice NUMBER(10)                                                            
    ,HomeCity VARCHAR(255) NOT NULL                                         
    ,HomeState VARCHAR(255) NOT NULL                                             
    ,HomeStreet VARCHAR(255) NOT NULL                                             
    ,EnrollDate DATE NOT NULL                                                       
    ,EnrollStatus VARCHAR(255) NOT NULL                                             
    ,StudyArea VARCHAR(255) NOT NULL                                             
    ,SpouseNameFirst VARCHAR(255)                                                  
    ,SpouseNameLast VARCHAR(255)                                                  
    ,ThesisTitle VARCHAR(255) NOT NULL                                             
    ,ThesisInternational VARCHAR(255)                                              
    ,ConvocationDate DATE                                                            
    ,ThesisAdvisor NUMBER(9) NOT NULL                                             
    ,Mentor NUMBER(9) NOT NULL                                                       
    ,CONSTRAINT STUDENTS_pk PRIMARY KEY (StudentId)                              
    ,CONSTRAINT STUDENTS_Mentor_fk FOREIGN KEY (Mentor)                     
    REFERENCES FACULTY(FacultyId)                               
    ,CONSTRAINT STUDENTS_ThesisAdvisor_fk FOREIGN KEY (ThesisAdvisor)     
    REFERENCES FACULTY(FacultyId)                                                       
    And here is 2 inserts of random data
    INSERT INTO STUDENTS (StudentId, NameFirstS, NameMiddleS, NameLastS, PhoneHome, PhoneOffice, HomeCity, HomeState
    , HomeStreet, EnrollDate, EnrollStatus, StudyArea, ThesisTitle, ConvocationDate, ThesisAdvisor, Mentor)                               
    VALUES(778506631                                        
              , 'John'                                             
              , 'Jacob'                                        
              , 'Smith'                                             
              , 3125551234                                        
              , 5182293313                                        
              , 'Wilksbury'                                        
              , 'Texas'                                             
              , '14 Main Road'                                   
              , TO_DATE('04-SEP-2003', 'DD-MON-YYYY')          
              , 'Graduated'                                        
              , 'Physics'                                             
              , 'Why Move'                                        
              , TO_DATE('07-JUL-2008', 'DD-MON-YYYY')          
              , 157928743                                             
              , 997569876                                        
    INSERT INTO STUDENTS (StudentId, NameFirstS, NameLastS, PhoneHome, HomeCity, HomeState, HomeStreet
    , EnrollDate, EnrollStatus, StudyArea, SpouseNameFirst, SpouseNameLast, ThesisTitle, ThesisInternational, ThesisAdvisor, Mentor)
    VALUES(251321188                                             
              , 'Larry'                                             
              , 'Timsfield'                                        
              , 2815551200                                        
              , 'Johnsburg'                                        
              , 'Florida'                                             
              , '223 Route 54'                                   
              , TO_DATE('09-SEP-2010', 'DD-MON-YYYY')          
              , 'Full Time'                                        
              , 'Medicine'                                        
              , 'Wanda'                                             
              , 'Timsfield'                                        
              , 'Cut Me Mick'                                        
              , 'Yes'                                                  
              , 997569876                                             
              , 101325587                                             
    I don't know how to format them like you did in your reply, so they look like a quote, so I hope that just pasting them in is okay.

  • How can I disable/enable specific cell on the matrix?

    Hi,
    Please help me, how can I disable/enable specific cell on the matrix?
    Regards,
    vinoth

    Hi,
    Do you want to control by sdk?
    If yes, then you can use CommonSetting property.
    Try this,
         Dim oMatrix As SAPbouiCOM.Matrix
               Dim oRowCtrl As SAPbouiCOM.CommonSetting
               oMatrix = frm_id.Items.Item("mat_id").Specific
               oRowCtrl = oMatrix.CommonSetting()
               oRowCtrl.SetCellEditable(1, 2, False)
    Regards,
    silambu

  • I have a Verizon IPhone 4 and i can't figure out how to get my ringtones from an app to my iTunes account, it doesn't have a tab for Ringtones! I have tried unplugging it and checking if would show up but it didn't, how do you enable the ringtone folder?

    I have a verizon IPhone and i can't figure out how to get my ringtones from the app to iTunes, my account doesn't have a ringtone section in the liRingtone Folder?brary, how do you enable the ringtone folder?

    Edit > Preferences.  Select the check box for Ringtones, this will add them to the listing in iTunes. 
    Not sure that really answers your question though.

  • How do I enable the "fn  + enter" key to work as an "insert" function for windows on my mac laptop?

    how do I enable the "fn  + enter" key to work as an "insert" function for windows on my mac laptop?

    enable /disable function within the Bootcamp control panel within Windows Vista or 7

  • How can I enable the ability to create links when editing site text in BC?

    I am about to launch my first BC site for a client. I built the site using Muse. The client needs to update text and pics on their own using BC, which is fine, but when editing text, they are unable to create a link to another page. How can I enable the ability to create links when editing site text in BC? I can apparently do this in this post, but I don't see a way to do this for their site.

    Grid control should be used if you have multiple dbs to manage.
    But if you still want to install dbconsole, you can use dbca as already mentioned. it's much easier to do that using dbca.
    With the manual method, you create the repository via emca -repos create.
    Then you configure it using emca -config dbcontrol db. This will ask for sys passwords, ports setting etc...

  • I disabled my Macbook  Hard Disk and lock the settings, after i try to reboot, the system wouldn't come up. It refuses to read instructions from the hard disk. How can i enable the hard disk when the system wouldn't come up?

    I disabled my Macbook  Hard Disk and lock the settings, after i try to reboot, the system wouldn't come up. It refuses to read instructions from the hard disk. How can i enable the hard disk when the system wouldn't come up?

    How do you disabled it if running the same?

  • I can't change any information for any songs in my library, everything is just greyed out.  How can I get the ability to edit my song information?

    I can't change any information for any songs in my library, everything is just greyed out.  How can I get the ability to edit my song information?

    I found one other way to do it.  I just deleted them all out of my iTunes library. Now I can re-import them from Window's My Music file with the original artists' names intact.
    Thanks for your help, Matt!

  • TS2446 My iphone 5s has been disabled do to forgotten pin #. How do I enable the phone

    I have a company IPhone5s. In working with my settings i inadvertantly assigned a new pin and then forgot what is is. I tried a few times to access my phone with what i thought was the correct pin, but after trying several times my phone became disabled. How do i enable the phone again

    iOS: Forgotten passcode or device disabled after entering wrong ...

Maybe you are looking for

  • Code works on new form not on older form

    Hi I am trying to change an existing form (add some code). I tested the code in a new form I create on my computer but when I do the same on a form supplied and created on a different computer the code won't work What I see is that the form propertie

  • Spool List Recipient

    System is ECC 6.0. SCOT has been configured and I am able to send mails from SAP to E-mail recipients.  I am able to give only one email ID as spool recipient when I schedule job in SM36.  I want the output(spool) that is generated to be sent to mult

  • Storage Type 916 in the outbound delivery

    SAP GURU, When i am creating a outbound delivery against a sales order...as my Plant is warehouse mnamanged so Warehouse will automatically get determined in the delivery based on SPRO setting but i am not able to find out how storage type 916 at the

  • German umlauts are not shown correctly, when a received e-mail is opened the first time. What can I do?

    When I open a received e-mail the first time, German umlauts (ä, ö, ü) are not shown correctly. Instead of them there are characters like §,$. When I close the e-mails and open them again the German umlauts are shown correctly. I don't know how to so

  • Caller ID and Text Messaging Alerts

    Does anyone know if there is an App. or board where I can suggest one be made that will tell you if you have say an incoming call or text message without displaying the number etc. I've turned off the text message preview feature which still displays