How to disable the cell from being edited

how to make a column in a jtable ineditable .i.e when i click on a column in a table the cell is highlighted and the caret is show .
due to this i am unable to use the double click on the left button coz as soon as i click once the left button the cell becomes editable and the caret appears.
i wanna make it in editable / disable the editable option of the cell can anyone tell me how

That's no problem if you're using DefaultTreeModel, you just rewrite the isCellEditable(col,row) function.
For example here, you can only edit cells of the first column (but you can test each cell separately if you really want ;-) ):
public boolean isCellEditable(int paramRow, int paramCol)
if (paramCol == 0)
return true;     
return false;

Similar Messages

  • How to stop the Dialog from being dragged

    I was hoping that someone could tell me when calling a Dialog from Jframe, a how to stop the Dialog from being dragged
    while a dialog is showing.
    When it is visible I can still click and drag the Dialog
    I want to set it so you can not drag it until the dialog has be closed.

    If you don't have access to the parent frame, a "hack" that usually works:
    Frame frame = Frame.getFrames()[0];
    if (null != frame && frame instanceof JFrame){
    JFrame jf = (JFrame)frame;
    JDialog jd = new JDialog(jf, "title");
    ... code here ...
    As each JFrame (or Frame) is opened, its stored in the array of Frames that you can get. Same thing with Dialog.getDialogs(). Almost always, at least so far for me I've never had this problem, the [0] index is the main window opened, or the parent/top frame. I'd put the check in there to be safe and make sure its a JFrame and usually you'll only have the one JFrame.

  • Report Painter - disable the variable from being diplayed on the selection

    Hi guys,
    I' using variables Fiscal Year 1GJAHLJ  and Previous Year 1GJAHVJ in my report, but the variable 1GJAHVJ is  displayed on the selection screen as Current Year, which confusing the users who are running the report.
    Can I change the description of the variable (GS12 didnt work) or completely disable from being displayed on the selection screen.
    You input is very valuable.
    Thank you
    Regards

    Use 1GJAHR and 1GJAHVJ variables for Current Fiscal Yr and Previous Year respectively.
    1GJAHVJ ( = '&1GJAHLJ'-1) is a dependent of what you input as Current Year, therefore, no need to manually enter for previous year.

  • How to disable the assignment block's Edit button

    Hi guys,
    I need to disable the edit button in assignment block Parties Involved on an opportunity. Only authorised people would be able to see Edit button as enabled.
    I'm not able to do this in the BTPARTNER/Partner as I don't get process id and order id in Partner view.
    Kindly suggest a way to disable the EDIT button of assignment block (in display mode).
    Regards,
    Shaili

    Make use of Parameter ID to set the values at Document Header page and on individual assignment block get this value to enable or disable the button.
    Regards,
    Harshit

  • TS3276 On received mail, I delete sender's name, address, etc. then forward it.  The forwarded mail has a duplicate of the original mail, show original sender's name, etc.  How to prevent the duplicate from being sent?

    How to prevent duplicate of orginal mail (with original sender's name, address) being "attached" when forwarded?

    Maybe I am mis-understanding what you are seeing.
    When I forward a message, the receiver will see the original mail (unless I edit it, such as removing any previous sender's information) and the length will be the same as the message was before forwarding except for the added line "Begin forwarded message" (again, unless I edit bits out), and there will be no attached copy of the original message.
    So when you say in your reply above "The orginal email with the sender's name and address was also sent with my forwarded email." do you mean:
    a) that it is still visible at the head of the text of the message (which I was saying does not happen for me because "after hitting delete, the previous sender's information disappears." [and since] "it has disappeared, it cannot be in your forwarded mail." Disappeared means it is not there.
    b) another copy of the original message is attached to the forwarded email at the end, either as an included file or as repeated text.
    c) some other situation.
    Sorry about the previous mis-spellings! I hope that we can get to the bottom of this.

  • How to disable the message from setUser and setPassword

    When I call OracleConnectionCacheImpl.setUser and setPassword,
    I get some message like this:
    Setting the user name and passwwdd xxxx xxxxx
    How can I disable this message?

    You are correct.  The only way to stop it, is to turn off iMessage.  Your frustration is actually the reason they made iMessage.  It was designed so you could be working on your Mac, and if you recieved a text message, you could reply with out having to locate your phone.  I understand it can be frustrating because in my expeirence, when I'm away from my desk, anyone with access to my computer can then sit there and enjoy my conversation with out me knowing about it... I have since started logging out of Messages on my Mac when I walk away.  then no one can see it, and when I log back in, the messages are synced back up again.  Good luck!!  Cheers!

  • How to stop a form from being editable

    Hi,
    we created a form for a client that their auditors are simply downloading, completing and submitting back to the client via form upload. the fowm contains dropdon fields and text areas. the client then needs to send the form to a third party. The form needs to be locked so no amendments can be made. The client has tried combining the form with an additional pdf, but the text areas then do not show overflow, the "+" appears in bottom right corner but can not be clicked to expand. Can someone help/advise the solution please...doing our heads in now....

    Hi,
    There is a LoclAllFields solution, but when the fields are readOnly you will not be able to access data below the bounds of the field (not visible).
    I have a form on our website that was developed a few years ago: http://www.assurehsc.ie/files/2007-08-31_Designer_Risk_Assessments_Example-1.pdf
    It is intended as a sample/information/instruction tool. Because it is up on the web I wanted visitors to explore the look and feel, but not to download an use at will. So the fields are set to 'open', but the initial value is read on the enter event, stored and then on exit the original value is restored.
    This is a solution from the forum (Stefan, I think). If you insert a script object called 'Utils', with the following javascript:
    var sOriginalValue = "";
    Then in the fields enter event:
    Utils.sOriginalValue = this.rawValue; // store original value into script object variable
    And in the fields exit event:
    this.rawValue = Utils.sOriginalValue; // restore original value from script object variable
    Utils.sOriginalValue = ""; // reset saved value
    This solution runs all the time. In your case you would need a flag to track if the script it to run or not, eg turning on and off the feature.
    Hope that helps,
    Niall

  • RESTORING THE DATABASE AFTER BEING EDITED OR DELETED

    How to restore the database after being edited? I m using sql server 2008 R2, I've done backup with some foolish knowledge and many tables have disappeared from the database. I want to get them back. Please help me.

    Do you have backup which includes data which has been edited/removed by you .If so below query might help.
    use master
    go
    alter database db_name set single_user with rollback immediate
    go
    restore database db_name from disk='locaion of backup'
    with replace,recovery
    If you have transaction lgo backups as well please dont use above method.In such case you will need to  first restore full backup with no recovery like below and then apply all transaction logs with no recovery
    but the last transaction log with recovery( last trn log just before you edited)
    use master
    go
    alter database db_name set single_user with rollback immediate
    go
    restore database db_name from disk='locaion of backup'
    with replace,norecovery
    Hope this helps
    More details in below link
    http://www.karaszi.com/SQLServer/info_minimizing_data_loss.asp
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

  • Stop the Frame from being able to be dragged

    Hi all
    I was hoping that someone could tell me how to stop the frame from being dragged
    while a dialog is showing.
    I am using this code to call the dialog.
    When is is visible I can still click and drag the frame behind it.
    I want to set it so you can not drag it until the dialog has be closed.
        public void runStartup() {
            Login dlg = new Login(this, "Login", true);
            Dimension dlgSize = dlg.getPreferredSize();
            Dimension frmSize = getSize();
            Point loc = getLocation();
            dlg.setLocation((frmSize.width - dlgSize.width) / 2 + loc.x,
                            (loc.y + 22));
            dlg.setModal(true);
            dlg.pack();
            dlg.show();
        }

    here is the Login Class
    package build0_0_1.dialogs;
    import java.awt.BorderLayout;
    import java.awt.Frame;
    import javax.swing.JDialog;
    import javax.swing.JPanel;
    import java.awt.*;
    import com.borland.jbcl.layout.XYLayout;
    import com.borland.jbcl.layout.*;
    import javax.swing.JLabel;
    import javax.swing.JComboBox;
    import javax.swing.JPasswordField;
    import javax.swing.JButton;
    import javax.swing.ImageIcon;
    import build0_0_1.images.image_pics;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseAdapter;
    import java.awt.event.FocusEvent;
    import java.awt.event.FocusAdapter;
    import build0_0_1.mysql.MYSQLDAO;
    import build0_0_1.Command;
    import javax.swing.*;
    import java.sql.SQLException;
    * <p>Title: </p>
    * <p>Description: </p>
    * <p>Copyright: Copyright (c) 2005</p>
    * <p>Company: </p>
    * @author not attributable
    * @version 1.0
    public class Login extends JDialog {
        ImageIcon back;
        MYSQLDAO mysqlDAO;
        Command command;
        JPanel panel1 = new JPanel();
        XYLayout xYLayout1 = new XYLayout();
        JLabel loginLabel = new JLabel();
        JLabel nameLabel = new JLabel();
        JLabel passwordLabel = new JLabel();
        JComboBox jComboBox1 = new JComboBox();
        JPasswordField passwordField = new JPasswordField();
        JButton loginButton = new JButton();
        JButton cancelButton = new JButton();
        JLabel backLabel = new JLabel();
        JLabel logoLabel = new JLabel();
        JComboBox locationComboBox = new JComboBox();
        JLabel locationLabel = new JLabel();
        public Login(Frame frame, String string, boolean _boolean) {
            super(frame, string, _boolean);
            try {
                setDefaultCloseOperation(DISPOSE_ON_CLOSE);
                jbInit();
                pack();
            } catch (Exception exception) {
                exception.printStackTrace();
        public Login() {
            this(new Frame(), "Login", false);
        private void jbInit() throws Exception {
            this.setResizable(false);
            this.setUndecorated(true);
            this.setSize(new Dimension(450, 220));
            back = new ImageIcon(image_pics.LOGIN_BACK);
            logoLabel.setIcon(new ImageIcon(image_pics.SMALL_LOGO));
            panel1.setLayout(xYLayout1);
            panel1.setMinimumSize(new Dimension(450, 220));
            panel1.setPreferredSize(new Dimension(450, 220));
            loginLabel.setText("Login");
            nameLabel.setFont(new java.awt.Font("Lucida Grande", Font.PLAIN, 11));
            nameLabel.setText("User Name");
            passwordLabel.setFont(new java.awt.Font("Lucida Grande", Font.PLAIN, 11));
            passwordLabel.setText("Password");
            backLabel.setIcon(back);
            passwordField.setFont(new java.awt.Font("Lucida Grande", Font.PLAIN, 11));
            passwordField.setText("Enter Password");
            passwordField.addFocusListener(new
                                           Login_passwordField_focusAdapter(this));
            loginButton.setBackground(new Color(231, 231, 231));
            loginButton.setFont(new java.awt.Font("Lucida Grande", Font.PLAIN, 11));
            loginButton.setText("Login");
            loginButton.addActionListener(new Login_loginButton_actionAdapter(this));
            cancelButton.setBackground(new Color(231, 231, 231));
            cancelButton.setFont(new java.awt.Font("Lucida Grande", Font.PLAIN, 11));
            cancelButton.setActionCommand("cancelButton");
            cancelButton.setSelected(true);
            cancelButton.setText("Cancel");
            cancelButton.addActionListener(new Login_cancelButton_actionAdapter(this));
            jComboBox1.setFont(new java.awt.Font("Lucida Grande", Font.PLAIN, 11));
            jComboBox1.setEditable(true);
            logoLabel.setBorder(null);
            logoLabel.setHorizontalAlignment(SwingConstants.CENTER);
            logoLabel.setHorizontalTextPosition(SwingConstants.CENTER);
            logoLabel.setText("");
            locationLabel.setFont(new java.awt.Font("Lucida Grande", Font.PLAIN, 11));
            locationLabel.setText("Location");
            locationComboBox.setFont(new java.awt.Font("Lucida Grande", Font.PLAIN,
                    11));
            panel1.add(cancelButton, new XYConstraints(337, 170, -1, -1));
            panel1.add(loginButton, new XYConstraints(245, 170, -1, -1));
            panel1.add(loginLabel, new XYConstraints(208, 21, -1, -1));
            panel1.add(logoLabel, new XYConstraints(21, 20, 57, 54));
            panel1.add(passwordLabel, new XYConstraints(99, 141, -1, -1));
            panel1.add(locationLabel, new XYConstraints(104, 72, -1, -1));
            panel1.add(nameLabel, new XYConstraints(90, 106, -1, -1));
            panel1.add(passwordField, new XYConstraints(185, 138, 219, -1));
            panel1.add(jComboBox1, new XYConstraints(183, 103, 219, -1));
            panel1.add(locationComboBox, new XYConstraints(183, 67, 219, -1));
            panel1.add(backLabel, new XYConstraints(0, 0, 451, 223));
            getContentPane().add(panel1);
            panel1.grabFocus();
         * Exit action performed.
         * @param actionEvent ActionEvent
        public void cancelButton_actionPerformed(ActionEvent actionEvent) {
            System.exit(0);
         * Login to MySQL Server. Using User ame and Password
         * This pass into MYSQLDAO user Name and Password
         * @param actionEvent ActionEvent
        //This pass into MYSQLDAO user Name and Password
        public void loginButton_actionPerformed(ActionEvent actionEvent) {
            String pass = new String(passwordField.getPassword());
            if (!pass.equals("Enter Password")) {
                System.out.println("This the username   " +
                                   (String) jComboBox1.getSelectedItem() + "\n" +
                                   "Password is     " + pass);
                try {
                    mysqlDAO = new MYSQLDAO();
                    mysqlDAO.setUserName((String) jComboBox1.getSelectedItem().
                                         toString().
                                         trim());
                    mysqlDAO.setPassword(new String(passwordField.getPassword()));
                } catch (SQLException ex) {
                    // handle the error
                    System.out.println("SQLException: " + ex.getMessage());
                    System.out.println("SQLState: " + ex.getSQLState());
                    System.out.println("VendorError: " + ex.getErrorCode());
                } catch (Exception ex) {
                    // handle the error
                    System.out.println("Erro no registro do Driver Mysql!!!!");
                hide();
         * Password field select all.
         * Feild is select. The user can just start typing
         * and overright the password feild
         * @param focusGained FocusEvent
        public void passwordField_focusGained(FocusEvent focusEvent) {
            passwordField.selectAll();
    class Login_loginButton_actionAdapter implements ActionListener {
        private Login adaptee;
        Login_loginButton_actionAdapter(Login adaptee) {
            this.adaptee = adaptee;
        public void actionPerformed(ActionEvent actionEvent) {
            adaptee.loginButton_actionPerformed(actionEvent);
    class Login_passwordField_focusAdapter extends FocusAdapter {
        private Login adaptee;
        Login_passwordField_focusAdapter(Login adaptee) {
            this.adaptee = adaptee;
        public void focusGained(FocusEvent focusEvent) {
            adaptee.passwordField_focusGained(focusEvent);
    class Login_cancelButton_actionAdapter implements ActionListener {
        private Login adaptee;
        Login_cancelButton_actionAdapter(Login adaptee) {
            this.adaptee = adaptee;
        public void actionPerformed(ActionEvent actionEvent) {
            adaptee.cancelButton_actionPerformed(actionEvent);
    }

  • How can I secure an emailed Quote from being edited by the recipient?

    Hi, I'm a newbie with LiveCycle Designer ES 8.2.
    I have just finished creating a Quote Template.
    After I finished creating the Quote Template I saved it as an Adobe Static PDF Form (.pdf).
    I double clicked on the saved file and it opened in Adobe Acobat 9 Pro.
    I then e-mailed it to myself as a test and found that after downloading the file from my email, I could edit the text and numbers.
    It will not be a good idea to email an editable Quote to a client.
    What should I do that a Quote Template created in LiveCycle Designer ES 8.2 is secure from being edited by the client once the client received it per email?
    I did not find the answer to my problem from the Help Menu, or overlooked it.
    I will really appreciate it if someone can educate me in this.

    Hi Leah,
    you can protect a pdf from being edited in Acrobat Pro using the security features. (Advanced -> Security).
    The easiest way is securing the file with a password and allowing no edits.
    Here's the link to the online help:
    http://help.adobe.com/en_US/Acrobat/9.0/Professional/WSD012A4E1-51D1-4bcd-BA9F-EF03C6F20BB 6.html#top
    Of course that also means the recipient can't fill any forms any more (unless he removes the security with the password).
    A word of warning: as with all kinds of security the safety of it is only relative. There are tools out there which allow you to remove this protection in seconds.
    (which probably would be illegal under these circumstances)
    Background: the pdf specification only suggests that any pdf compatible application should care about the edit password. You practically can't enforce it. The tools I spoke of just ignore the security and save a new file.
    The only way to improve this is to use digital certificates or to set an open password.
    Regards,
    Mike

  • How to stop the Calendar from editing your input?

    How to stop the Calendar from editing your input?

    I am constantly finding that Calendar Version 8.0 thinks it knows what I want to type but it incorrectly takes numbers and days and times out of my input and changes my appointments. I hate this new supposedly "smart" feature. Even when I edit my event correctly a second or third time it rewrites my input incorrectly again. I have to use my iPhone to override the annoying editing on my mac. I am ready to find a new calendar program unless Apple allows users to input what they want without their information being incorrectly edited.

  • How to get the data from mysql database which is being accessed by a PHP application and process the data locally in adobe air application and finally commit the changes back in to mysql database through the PHP application.

    How to get the data from mysql database which is being accessed by a PHP application and process the data locally in adobe air application and finally commit the changes back in to mysql database through the PHP application.

    If the data is on a remote server (for example, PHP running on a web server, talking to a MySQL server) then you do this in an AIR application the same way you would do it with any Flex application (or ajax application, if you're building your AIR app in HTML/JS).
    That's a broad answer, but in fact there are lots of ways to communicate between Flex and PHP. The most common and best in most cases is to use AMFPHP (http://amfphp.org/) or the new ZEND AMF support in the Zend Framework.
    This page is a good starting point for learning about Flex and PHP communication:
    http://www.adobe.com/devnet/flex/flex_php.html
    Also, in Flash Builder 4 they've added a lot of remote-data-connection functionality, including a lot that's designed for PHP. Take a look at the Flash Builder 4 public beta for more on that: http://labs.adobe.com/technologies/flashbuilder4/

  • How can I disable a JInternalFrame from being "restored"?

    Sorry, I thought I should start a new thread for a new question.
    With my JInternalFrame, I have it minimized initially when it is created. Now, how can I prevent the user from opening or "restoring" that frame? Basically, I just want the "title" bar to appear, and disable the frame from opening up.
    thanks

    try this
    import java.awt.Dimension;
    import java.beans.PropertyVetoException;
    import javax.swing.JButton;
    import javax.swing.JDesktopPane;
    import javax.swing.JFrame;
    import javax.swing.JInternalFrame;
    import javax.swing.*;
    import java.beans.VetoableChangeListener;
    import javax.swing.event.InternalFrameAdapter;
    import javax.swing.event.InternalFrameEvent;
    import java.beans.PropertyChangeEvent;
    public class DesktopPane extends JDesktopPane
    implements VetoableChangeListener {
    JInternalFrame jif;
    JPanel p1;
    public DesktopPane() {
    p1 = new JPanel();
    JButton b = new JButton("Test");
    p1.add(b);
    jif = new JInternalFrame("test1", true, false, true, true);
    jif.getContentPane().add(p1);
    jif.setVisible(true);
    jif.setSize(new Dimension(200, 200));
    add(jif);
    jif.addVetoableChangeListener(this);
    try {
    jif.setIcon(true);
    } catch (Exception ex) {
    jif = new JInternalFrame("test2", true, false, true, true);
    jif.getContentPane().add(p1);
    jif.setVisible(true);
    jif.setSize(new Dimension(200, 200));
    add(jif);
    jif.addVetoableChangeListener(this);
    try {
    jif.setIcon(true);
    } catch (Exception ex) {
    public void vetoableChange(PropertyChangeEvent evt) throws PropertyVetoException {
    String property = evt.getPropertyName();
    if (property.equals(JInternalFrame.IS_ICON_PROPERTY)){
    boolean isIcon = ((Boolean)evt.getNewValue()).booleanValue();
    if (!isIcon){
    throw new PropertyVetoException("message", evt);
    }

  • How to disable the selection of "Title and logo URL of a SharePoint 2013 site" from browser

    how to disable the selection of "Title and logo URL of a SharePoint 2013 site" from browser or How can we able to set our custom default log to the sp2013 site using code.So that users are not allowed to change from browser again.
    Thanks &amp; Regards, Krishna

    Hi  Krishna,
    For your issue, you need to deploy a farm solution using HideCustomAction to hide site settings link. For example to hide “Title, description, and logo” link you can use below code:
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <HideCustomAction
    GroupId="Customization"
    HideActionId = "ProjectSettings"
    Location = "Microsoft.SharePoint.SiteSettings">
    </HideCustomAction>
    </Elements>
    Reference:
    http://social.msdn.microsoft.com/Forums/sharepoint/en-US/92f002b7-0e9c-424e-836a-de40c4e5d81f/hide-option-from-site-settings-page-in-sharepoint-2010?forum=sharepointdevelopmentprevious
    http://blog.milanchauhan.com/2013/06/add-custom-section-in-site-settings.html
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • How to remove the "0" from the sum cell when the other cells are empty?

    Hello!
    When I use the formula to sum the values from a few cells, there is a zero in the sum cell when the other cells are empty.
    My question concerns how to remove the 0 from the sum cell when the cells that will be summed are empty.
    Thank you!
    /Johan Strömbeck

    Hi,
    Please try the Mr. Laurence's suggestion first. Then, we may try the other workarounds.
    1) Go to Excel option> Advanced>Display Option for this worksheet> Uncheck Show a zero in cells that have zero value
    2) Go to Conditional Formatting>New Rule>Format only cells that contain> Value equal to 0> Format the color with white
    Hope it's helpful.
    Regards,
    George Zhao
    TechNet Community Support

Maybe you are looking for

  • IMac G4 hangs at apple logo screen after 10.5.8 update

    Hello, thanks for any help you can provide with this problem. Machine is iMac G4 flat panel. Did an erase and install of Leopard over firewire from iMac G5. Immediately copied 10.5.8 combo update I'd downloaded earlier from the G5 and ran it on the G

  • After installing 10g 10.1.2.0.0

    Dear all Please assist am unable to get the oem 10g application server control main page , when i click on the link it is opening the iis server page. n e comments highly appreciated. Thanks in advance and Best Regards Message was edited by: mohdazam

  • IPhoto 11 not saving edits to file

    Hi - I'm using iPhoto 11 on my iMac (new user) and I can make changes to photos (crop/rotate etc) which are reflected in iPhoto but then they are not saved in the original files in the Pictures folder.  I have tried to delete the com.apple.iphoto.pli

  • Clone Stamp Black Smudge

    I'm not good with Photoshop.  In fact, the clone stamp has always been one of my favorite tools.  But, I just bought Elements 12 and I find that my clone stamp is doing something strange.  In the circle, when I move it around the photo being edited,

  • 10.9.3 upgrade trashed all my files !!!

    Just upgraded to 10.9.3 and several of my accounts have been partially deleted, i.e. everything expect my working files. Everything in Library was deleted. Has anyone else experieved this?