Preventing JTree updates from uncompleted JTable edits

Hello there!!
I have an applet that displays an xml file in a JTree. Each node of the table represents specific elements of the xml file (some are not displayed by design). Also on the applet is a JTable that updates the displayed information depending on what node of the tree is clicked. The information displayed in the table includes names and values of attributes and names and values of xml elements not displayed in the JTree.
I can edit values in the table and update that tree effectively, so that is not a problem.
The problem I have is that if the user enters a value in the table, does not press enter and then clicks on another tree node, the entered value is copied into the new tree node. I would like to ignore all values if the user does not specifically press enter.
I have seen some code examples in previous posts that partially work, but can't get the entered values to be totally ignored.
I'm currently using the following code to handle the 'didn't press enter' bug.
        table.getEditorComponent().addFocusListener(
                new java.awt.event.FocusListener(){
            public void focusGained(java.awt.event.FocusEvent e) {}
            public void focusLost(java.awt.event.FocusEvent e){
                if ( table.getEditingRow() > -1 &&
                        table.getEditingColumn() > -1 ){
                    ((javax.swing.DefaultCellEditor)table.getCellEditor()).stopCellEditing();
        });So my question is: How do I prevent the value entered in the table cell from being copied to the newly clicked on tree node? Any assistance would be great.
Thanks (even just for reading!)
Simon
PS. When are we going to see the back of the stupid censorship in this forum?

Not too sure if this will help but here goes...
Normally in a JTable, editing is automatically stopped when the enter key is pressed so there is no need to do anything special there. If you don't want editing to stop when the mouse is clicked elsewhere in the table, what you should do is call cancelEditing() instead of stopEditing() in your focusLost method.
;o)
V.V.

Similar Messages

  • Deadline date preventing project update from PWA interface

    We have the following error when trying to update a project PDP through PWA. "An error has occurred when saving your project to the server. Please contact your administrator for assistance."
    We have identified in the project schedule one task that is the origine of the problem. In this task, there is a deadline date. If we remove the deadline date, we can update the project from PWA without any problem.
    The task has a deadline date and is completed at a 100%.  
    If someone has an explanation for this, I will be happy to hear it.
    Mermoz

    We are using project server 2010.  We have SP2 installed. I don't know CU last applied.
    We have this issue with one project. I can't reproduce the problem with another project.
    If a remove the Deadline Date and publish, then, PWA update works fine.
    If I add back the Deadline Date and publish, then, we get the same error message.
    Next, I will try to add back a different "Deadline date" and will report the result.
    Mermoz

  • How do I prevent Security Updates from overwriting (custom) PHP install?

    Hi,
    I've been forced into re-installing PHP from binaries after every Apple Security Update that upgrades PHP and I'm over it. Everytime Apple upgrades PHP, "their" compile overwrites mine and I lose my libraries. I have to completely wipe the Apple PHP install and re-compile. I've done this 3 or 4 times now in the past couple years...
    Is there any way to force the Security Updates to retain the install of "my" libraries? What about the update installer(s)? Where are they?
    12" PB 1.25   Mac OS X (10.3.9)  

    An Update shouldn't affect PHP, this is a server side language that is stored on the server for the implamintation of Dynamic Web Pages.
    Self-referentially short for PHP: Hypertext Preprocessor, an open source, server-side, HTML embedded scripting language used to create dynamic Web pages.
    In an HTML document, PHP script (similar syntax to that of Perl or C ) is enclosed within special PHP tags. Because PHP is embedded within tags, the author can jump between HTML and PHP (similar to ASP and Cold Fusion) instead of having to rely on heavy amounts of code to output HTML. And, because PHP is executed on the server, the client cannot view the PHP code.
    PHP can perform any task that any CGI program can do, but its strength lies in its compatibility with many types of databases. Also, PHP can talk across networks using IMAP, SNMP, NNTP, POP3, or HTTP.
    PHP was created sometime in 1994 by Rasmus Lerdorf. During mid 1997, PHP development entered the hands of other contributors. Two of them, Zeev Suraski and Andi Gutmans, rewrote the parser from scratch to create PHP version 3 (PHP3).
    Don

  • New WRT610Nv2 router preventing Windows Update from functioning properly

    I have installed my new WRT610Nv2 router and everything is great except 1 thing. It does not allow Windows Vista Update to run successfully. The update process runs automatically, identifies the updates, but gives an Error Code 646 after it appears to run through the whole process. Even after my PC security and the Router Firewall are completely disabled, the update process is not able to complete successfully. I have since manually downloaded the updates and installed them, but I want to avoid doing this for every update.
    What do I need to configure on my router to allow the Windows Update process to complete automatically.  

    Yes, I have completely disabled my firewall and security software on my PC and tried it. All my updates worked cleanly up until I installed the router. I use Norton Internet Security v17, and I my ISP is Rogers via cable.
    Its difficult to pinpoint because Windows Update was able to scan my PC and determine which updates were needed (This would not happen with my firewall enabled), and the 3 updates appeared to run straight through to the end. I will try the laptop (wireless) but its still running XP.
    I figure that there is some option on the router that I have not set that is interfering in the process. I installed the updates manually so at this point all I can do is wait until the next set of patches to recreate the problem.
    PF

  • Prevent firefox update from requiring reboot

    There must be a way to configure firefox to not require a reboot to complete updates. I've actually stopped using firefox because of this.

    I think this could be related to your Windows user privileges. I run with a high level of privileges, and I installed Firefox as myself (not as administrator). Maybe that's why I never need to restart Windows to update Firefox? Hopefully another volunteer more experienced at troubleshooting permission issues can sort it out for you.
    By the way, do you use the "background service" method of updating? These articles describes that option:
    * [[What is the Mozilla Maintenance Service?]]
    * [[Advanced settings for accessibility, browsing, system defaults, network, updates, and encryption]] (see Updates section)

  • Prevent software update from installing safari

    Am I really going to have to uncheck that box every time there is an itunes update on my windows box? Seriously?

    Thanks very much for your pointer. I somehow missed that menu option.

  • Problem w chrome registration failure when starting up mozilla from desktpo icon which prevents all updates from loading

    Have to close chrome registration window 3 to 4 times before I
    successfully get into mozilla home page
    I recently installed the latest version 3.6 3.7 and get the same problem

    Have to close chrome registration window 3 to 4 times before I
    successfully get into mozilla home page
    I recently installed the latest version 3.6 3.7 and get the same problem

  • Windows Media Player keeping Automatic Maintenance window/Windows Updates from doing auto-restart

    I have a system that is connected to a domain, and it runs a video playlist in Windows Media Player for digital signage upon bootup (and auto-login).  WMP is set to loop the videos over and over again, but it also is preventing automatic updates from
    installing and/or auto-restarting at 3:00AM in the morning (and yes, the system power management is set to keep the computer on all the time).
    How can I fix this?
    I have a GPO set up to install updates and restart automatically (option 4).  I tried the GPO option to use the Windows 8 maintenance window to install updates, and also tried turning that option off and just using a 3:00AM restart period.  Neither
    option seems to work, so it looks like Windows Media Player is preventing an auto-restart to finish the update installation.  Is there any way around this, so that Windows Media Player doesn't stop Windows Updates from doing its job?  I don't care
    if that means the video stops playing because it just starts up again on the next bootup.
    I looked at the WMP GPO's and the only option that sounds like it's related is the option to turn on or off the auto-updating of media info for WMP, but it has nothing to do with what I'm trying to accomplish.  If I missed something, let me know. 
    If there is some other way to accomplish this, such as associating and launching the playlist file with the Xbox Videos app, I would be fine with that, but I need it to loop the playlist continually (I also use the Shuffle option
    in WMP - ***see note below for another question).  I still want the system to automatically install updates and reboot on a regular schedule despite the video playing in the foreground.
    ***Side question: is there any way to turn Repeat and Shuffle options on in WMP without having to load the GUI (for scripting a playlist)?
    Just FYI: this system is actually using Windows Embedded 8.1 Industry Enterprise (from a MAPS account), but it isn't customized aside from not having the standard WinRT apps from a stock Win 8.1 install loaded - it is a stock install from the ISO. 
    From what I understand, it is the same as Windows 8.1 Enterprise, except that it is only licensed to be used as an "appliance" machine for a single role - which it is.  So I'm assuming that there are no actual differences from a "regular"
    Windows 8.1 SKU that would cause this issue.  If I am completely mistaken about this, please notify me on it.  The reason I'm making this statement is in case there are any differences in Embedded 8.1 Industry Enterprise that I am not aware of. 
    Otherwise, I welcome any assistance that would target a "regular" version of 8.1 Enterprise.  NOTE:  Someone said to post this into the Windows Embedded forum, but the only one that exists is the one for POSready - and this is HARDLY the
    POSready version of Windows Embedded that I'm using.

    Hi,
    Did you use the policy Local Computer Policy\Administrative Templates\Windows Components\Windows Update\Always automatically restart at the scheduled time?
    I noticed an description "restart with logged on users for scheduled automatic updates installations" policy is enabled, then this policy has no effect." it means if system installed some updates which unneeds restart computer, this policy would has no effect.
    In my opinion, your problem should not caused by WMP setting. please check your installed updates whether they need restart computer.
    In addition, Power Managment in Control Panel also can prevent the schedule task running.
    Control Panel\System and Security\Power Options\Edit Plan Settings\Change advanced power settings\Sleep\Allow wake timers
    Please make sure this option is enable.
    Roger Lu
    TechNet Community Support

  • How to prevent multiple users from updating the same data in coherence

    Hi,
    I have a Java Web Application and for data cache am using coherence 3.5. The same data maybe shared by multiple users which maybe in hundreds. Now how do I prevent multiple users from updating the same data in coherence i.e. is there something in coherence that will only allow one user a time to update. If one user is in a process of updating a data in coherence and some other user also tries to update then the second user should get an error.
    Thanks

    I have a question on the same line. How can I restrict someone from updating a cache value when I a process is already working on it. I tried locking the cache key but it does not stop other process to update it , it only does not allow other process to get lock on it.

  • Prevent multiple users from editing/approving the same form SPD 2013,SP 2013

    Hello all, I have a workflow with a to do task, the task is assigned to a group so any of the users in that group can go in and do a quality check on form data and approve it.  How do I prevent multiple users from working on the
    same form? do I just require check out? or is there a way to notify the rest of the group that a user has already started the quality check.

    The "Require Checkout" option is your best bet.  You can also enable the auto checkout on edit option to allow minimal effort on the side of the user.  Other users will then get the error message stating the item is checked out, if they try to
    edit it.
    If you'd like, you could add a workflow to the task list that triggers when something is changed.  That workflow can check if the item is checked out and if so, email the other users assigned to the task.
    I trust that answers your question...
    Thanks
    C
    |
    RSS |
    http://crayveon.com/blog |
    SharePoint Scripts | Twitter |
    Google+ | LinkedIn |
    Facebook | Quix Utilities for SharePoint

  • Prevent multiple users from updating coherence cache data at the same time

    Hi,
    I have a web application which have a huge amount of data instead of storing the data in Http Session are storing it in coherence. Now multiple groups of users can use or update the same data in coherence. There are 100's of groups with several thousand users in each group. How do I prevent multiple users from updating the cache data. Here is the scenario. User logs-in checks in coherence if the data there and gets it from coherence and displays it on the ui if not get it from backend i.e. mainframe systems and store it in coherence before displaying it on the screen. Now some other user at the same time can also perform the same function and if don't find the data in coherence can get it from backend and start saving it in coherence while the other user is also in the process of saving or updating. How do I prevent this in coherence. As have to use the same key when storing in coherence because the same data is shared across users and don't want to keep multiple copies of the same data. Is there something coherence provides out-of-the-box or what is best approach to handle this scenario.
    Thanks

    Hi,
    actually I believe, that if we are speaking about multiple users each with its own HttpSession, in case of two users accessing the same session attribute in their own session, the actually used cache keys will not be the same.
    On the other hand, this is probably not what you would really like, you would possibly like to share that data among sessions.
    You should probably consider using either read-through caching with the CacheLoader implementor doing the expensive data retrieval (if the data to be cached can be obtained outside of an HTTP container), or side caching with using Coherence locks or entry-processors for concurrency control on the data retrieval operations for the same key (take care of retries in this case).
    Best regards,
    Robert

  • How do I prevent my iphone from downloading my entire email address book from my computer when I do my "updates" .  My contact list is transfered to my iphone and then I have the laborous task of manuely deleting the unwanted unnecessary "contacts" now.

    How do I prevent my iphone from downloading my entire computer email address book when I "update" my phone by plugging it into my computer and do the update procedure.  I am having my phone "contacts" swamped with the entire contacts in my email on my computer and then I am having to manually delete them each time I update my phone...? thanks for any assistance on this...mm

    Thank you for your rapid...excellent answer!!  I feel abit foolish...but I am in a learning process and you are a wise teacher! thanks...mm

  • Patch 121081-03 will prevent updates from appearing

    Patch 121081-03 will prevent updates from appearing in the hosted application. We are going to bad patch the current rev and release a fix ASAP. The associate change request is 6395708.
    Summary:
    Users who manage systems through the SunUC hosted application should not install 121081-03. The patch will prevent updates for the system from appearing in the application
    Work Around:
    # /usr/lib/cc-cfw/framework/lib/cc-client-adm stop
    # /usr/lib/cc-cfw/framework/lib/cc-client-adm disable
    # /usr/lib/cc-cfw/framework/lib/cc-client-adm enable
    # /usr/lib/cc-cfw/framework/lib/cc-client-adm start
    Symptoms
    Error messages in /var/adm/messages like this:
    Mar 8 14:31:54 magrathea IM-CC_ENG-inv cc-invagent: [ID 702911 daemon.warning]Inventory Agent returned error: 1 : /usr/lib/cc-cfw/platform/invagent/bin/cc-invagent: @JAVA_HOME@/bin/java: not found
    When cc-invagent is run on the command line I see errors like this:
    touch: @LOCK_DIR@/lock.14769 cannot create@LOCK_DIR@: No such file or directory

    Patch 121081-03 will prevent updates from appearing in the hosted application. We are going to bad patch the current rev and release a fix ASAP. The associate change request is 6395708.
    Summary:
    Users who manage systems through the SunUC hosted application should not install 121081-03. The patch will prevent updates for the system from appearing in the application
    Work Around:
    # /usr/lib/cc-cfw/framework/lib/cc-client-adm stop
    # /usr/lib/cc-cfw/framework/lib/cc-client-adm disable
    # /usr/lib/cc-cfw/framework/lib/cc-client-adm enable
    # /usr/lib/cc-cfw/framework/lib/cc-client-adm start
    Symptoms
    Error messages in /var/adm/messages like this:
    Mar 8 14:31:54 magrathea IM-CC_ENG-inv cc-invagent: [ID 702911 daemon.warning]Inventory Agent returned error: 1 : /usr/lib/cc-cfw/platform/invagent/bin/cc-invagent: @JAVA_HOME@/bin/java: not found
    When cc-invagent is run on the command line I see errors like this:
    touch: @LOCK_DIR@/lock.14769 cannot create@LOCK_DIR@: No such file or directory

  • How can I prevent Word 2013  from opening a PDF file to edit it?

    As per the title - I create training manuals in MS Word and save as PDF for distribution to clients.
    How cna I prevent them from opening and editing them with Word 2013?

    You can restrict editing and printing of a PDF document by setting permissions when you create the initial PDF. This can be done as:
    Open Word document to convert.
    Go to Acrobat tab on Word ribbon -> Select Preferences button.
    On Security tab of the Preferences dialog, tick mark the check box for "Restrict editing and printing of the document. A password will be required in order to change these permission settings."
    Specify a password in "Change Permissions Password" tex box.
    Click OK.
    Input the password again in the confirmation dialog.
    Go to "Create PDF" button.
    The PDF thus created, will have editing restricted. And Word 2013 will not be able to open it.
    Thanks.

  • Trouble updating a JtextArea from a JTable ListSelectionListener..

    Hi, I'm having trouble updating a JtextArea from a JTable ListSelectionListener, it is working for another JTextArea but I have created JNMTextArea which extends JTextArea and I am getting no data passed to it.
    Any help is really greatly appreciated. Im a relative newbie to Java.
    Here is the class declaration for JNMTextArea
    public class JNMTextArea extends JTextArea
         //Constructor
         public JNMTextArea(String text){
              super(text);
              setLineWrap(true);
              setEditable(false);
         //Constructor
         public JNMTextArea()
              this(new String());
         //This sets the data in setText, works ok.
         void displayPacket(Packet p){
              //Function works fine
              //Need to pass this data to the JNMTextArea!!!
              setText(buffer.toString());
              setCaretPosition(0);
    Here is where I use JNMTextArea, Im
    class JNMGui extends JFrame implements ActionListener, WindowListener{
         public static JNMTextArea txtPktContent;
         //Constructor
              JNMGui(){
                   buildGUI();
         private void buildGUI(){
         mainWindow = new JFrame("Monitor");
         tblPacket = new JTable(tblPacketM);
         tblPacket.setToolTipText("Packet Panel");
         tblPacket.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
         if (ALLOW_ROW_SELECTION) {
              ListSelectionModel rowSM = tblPacket.getSelectionModel();
              rowSM.addListSelectionListener(new ListSelectionListener() {                     public void valueChanged(ListSelectionEvent e) {
                        if (e.getValueIsAdjusting())
                             return;
                        ListSelectionModel lsm =      (ListSelectionModel)e.getSource();
                        if (lsm.isSelectionEmpty()) {
                             System.out.println("No rows are selected.");
                        else {
                             int selectedRow = lsm.getMinSelectionIndex();
                             selectedRow++;
                             String str;// = "";
                             //Unsure if I need to create this here!
                             txtPktContent = new JNMTextArea();
                             //This works perfectly
                             txtPktType.append ( "Packet No: " + Integer.toString(selectedRow) + "\n\n");
                             Packet pkt = new Packet();
                             pkt = (Packet) CaptureEngine.packets.elementAt(selectedRow);
                             if(pkt.datalink!=null && pkt.datalink instanceof EthernetPacket){
                                  str = "Ethernet ";
                                  //THis works txtPktType is another JTextArea!!          
                                  txtPktType.append ( s );
                                  //This is not working
                                  //I realise displayPacket return type is void but how do get
                                  //the setText it created to append to the JNMTextArea??               
                                  txtPktContent.displayPacket(pkt);
              //Adding to ScrollPane
              tblPane = new JScrollPane(tblPacket);
              txtPktTypePane = new JScrollPane ( txtPktType );
              txtPktTypePane.setToolTipText("Packet Type");
              txtPktContentPane = new JScrollPane ( txtPktContent );
              txtPktContentPane.setToolTipText("Packet Payload");
              panel.add( tblPane, BorderLayout.CENTER );
    //End Class JNMGui

    void displayPacket(Packet p){
              //Function works fine
              //Need to pass this data to the JNMTextArea!!!
              setText(buffer.toString());
              setCaretPosition(0);
    This seems really odd. Notice that you pass in "p" but use "buffer". Where is "buffer" defined?

Maybe you are looking for

  • How to create raw partition in a local zone?

    I tried to search for an answer for my question, but I spent a week and still no luck. What I am trying to do is to create raw partitions for Sybase in a local zone. I tried to add device and set match to the block and raw device. However, when I tri

  • Filter error

    Hi, I´m just learning and developing my first filter for After Effects I found something really weird. I´m just making an easy zoom in and zoom out effect using 2 imput images, it seems to work OK in Pixel Bender. this is my code: <languageVersion :

  • XML Encoding error

    Hi,

  • Bug in CC?

    I was informed that there was a bug in CC that led to apps being shown as uptodate, but actually can't be found, and that it was to be fixed soon. Does anyone know when?

  • How can I take a text message and either print it out or forward it to my email address

    I need to save the text message for proof of conversation in the future