JTable discards input when focus lost

Hi! Im running Java 1.4.2-b28.
Problem as follows:
I have a JTable where the user can enter som data.
I also have a button with the caption "Minimize" that starts processing of the same data.
If i enter a value into the table (say "foo") and press "Minimize" when the cell is in editing mode, "foo" is NOT SAVED into the JTable's TableModel! getValueAt(int row, int col) returns an old value instead!
How can i change the focus lost behaviour on the cell? Is this a bug??
Regards
/Alex

Found an answer to this, sorry everyone. Well, here it is:
http://forums.java.sun.com/thread.jsp?thread=350530&forum=57&message=1453945

Similar Messages

  • JWindow Close when focus lost

    I have a borderless JWindow that has multiple components inside of it.
    I would like the window to close when someone clicks outside of the window.
    "whenFocusLost" does not work, clicking on components inside the window also fires this event.
    What technique should I be using?
    thanks,
    -brillo

    I would like the window to close when someone clicks outside of the window.Is this window the only visible component when shown? Or do you have a visible GUI before and after the window is shown?
    If the latter, I would suggest using a JPopupMenu, for which this is the default behavior.
    db

  • Focus lost when a popup menu is activated...

    It seems that when a popup menu is activated the component invoker lost focus. this is ugly because a focus lost can trigger unexpected events (formatting, validating, etc). how can I avoid this?
    thanx

    I must seem a bit weird being the only one to reply to my posts, but I found what is occuring, is that when I do the mouse click the InputVerifier for that JTextField is firing. This is causing a problem, because this input verifier pops up a dialog saying please enter correct values ... and then highlights the entire text field. Problem is if the input is currently invalid I can't use the mouse.
    Any ideas?
    Tom

  • JTable Focus Lost

    Hi All,
    I have a JTable with 6 columns and the last column has a button attached called EXPAND.
    Also I have another navigation buttons called Next, Back, Save and Refresh.
    Whenever I make changes to the cell and then click on the expand button of the 6th column, it saves my changes.
    but when i make changes to the cell and then click some where else (other than on the JTable) ...here for example on the Refresh button ...and then click on the expand button on JTable, I could not save my changes ...
    i.e. it is not invoking my focusLost ...Is there any work around for this problem ...
    I am posting my focus Lost code :
    public void focusLost(FocusEvent e) {
    if (jTable.getSelectedColumn() >= 0) {
    if (jTable.getColumnName(jTable.getSelectedColumn()).equalsIgnoreCase("Expand")) {
    saveData();
    Many Thanks
    Mahesh

    try tableChange Listener, something like this
    class TableListener
           implements TableModelListener {
          private JTable table;
          public TableListener(JTable table) {
          this.table = table;
          public void tableChanged(TableModelEvent e) {
             int editRow = table.getEditingRow();
             String value = table.getValueAt(editRow, 1).toString();
             if (e.getType() == TableModelEvent.UPDATE) {
                save();
    [/code                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How to handle cell events like focus lost in  jtable

    Hi,
    I have faced a problem relating jtable.Upon focus lost on particular cell the values in the other cells need to change accordingly.Out of 7 columns, upon entering an integer value in one column accordingly 3 columns need to update the values fetched from database and get disabled.The columns being updated have a combobox in which the value is to be shown.....Please look at it and provide a working solution.
    Looking forward,
    chandra

    Try using a TableModelListener:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=566133

  • JTable Blank Rows When INSERT/DELETE in other panel with same ViewObject

    Hi,
    Jdev 10.1.2
    JClient
    2 panels based on same ViewObject in same AM
    One panel with Grid UI => JTable
    Other panel with Form UI
    When I insert or delete a record in the panel with Form UI and return to the panel with JTable blank rows are displayed.
    The problem remains even after commiting before returning to JTable panel.
    When I activate the execute button in the JTable panel, the display is OK but the currency is lost.
    I suppose calling the refresh method when returning to the JTable panel should solve the problem.
    Can you please suggest me a server-side/model workaround:
    refresh (which option to use ??)
    Thanks
    Frederic
    PS I tried the workaround of thread 10.1.2 JClient binding Error. but that doesn't help.

    Same problem with default wizard generated Master-Detail Form.
    When in the detail more then 10 rows exist, the scrollbar shows that not all rows are displayed.
    If I use the scrollbar to view the last rows they are blank, in order to display them I must activate the next button one time for each additional row.
    The workaround is to enter -1 in the range size of the iterator.
    But what if the range size is 10.
    Is the blank rows display a bug?
    OR
    Must the scrolling area (size of JScrollPane) be defined according to the range size of the iterator?
    If the latter is true:
    Can somebody give me some clues on which attributes of the JScrollPane must be set (PreferredSize, MinimumSize ??) and on how to calculate this area: total width & total height if the row height for the table is set to 20?
    Your help will be appreciated
    Frederic

  • Focus Lost on Tree Cell Edit

    I am trying to force changes made in a tree cell edit when focus to that tree node has been lost(like on an enter button press) but it always reverts to the old value. i have tried adding a CellEditorListener to force an enter key press on the editingCanceled action but this still reverts the value.
    Anyone have any ideas on how to fix this?
    Thanks.

    Hi,
    Try to use
        call method cl_gui_control=>set_focus exporting control = grid1.

  • Feature Request: Microsoft Excel 2013 - Don't hide status bar text on focus lost (AVERAGE, COUNT, SUM)

    Could you please disable hiding of status bar text on focus lost.
    I use this in Excel 2013, where I select a few cells, then move to another Excel to write the sum of those cells as read from the status bar or to check with other values in the second window. This really makes my life easier and I see no reason to hide
    the status bar text when the window looses focus.

    Hi,
    Thanks for your suggestions.
    You can also send your feedback to the Office team by the steps as below:
    1. Inside any new Office application you’ll see a yellow smiley face in the top-right corner. Click on the face and choose either
    Send a Smile to send positive feedback or
    Send a Frown to send negative feedback.
    2. In the window that appears, provide details about your feedback or issue. Also, be sure to provide a link to this thread.
    3. Next, you can choose whether or not to send a screenshot. You can also enter your email address so the Office team can contact you directly if they have any questions.
    Note: Most feedback requests do not result in responses from the Office team.
    4. Click the Send button at the bottom of the form to send your feedback.
    Best Regards,
    Judy

  • Focus Lost on Panel

    I need to be able to trap when focus is lost from a JPanel. How do I go about this?

    Would "requestFocus()", or "grabFocus()" not work? In my panels if I wish to keep it focussed on I just write "requestFocus();" at the beginning of a method that is consistently called, of course, I could be doing somethign wrong anyway, but it works for me.

  • Focus Lost - Sticky Cursor

    Hi folks,
    When using 10gRel2 we get a lot of 'focus lost' problems. I read all threads here and in metalink; this problem is a very serious one and in some cases hard to reproduce. at least 10 different situation causes different focus lost situations.
    Oracle has concentrated that issue in the base bug 5358366.
    The fix for the focus lost problems will be implemented in JRE 1.5.0_9 which is currently not available at SUN. Nevertheless, has anybody received that internal version for testing? What's your experience?
    Thanks, werner

    Hi kndwds,
    Would be very interested in sharing some information re your Focus Lost question. We have had very similar issues in all versions of Forms (and occassionally have managed to create test cases) resulting in a number of patches. In 10.1.2 and the Sun JVM, the issue is very much worse, but currently we can not reproduce a repeatable test case.
    I have reviewed all the bugs, but this does not provide much meaningful information.
    Can you provide any update on the situation with your TAR, and if at all possible, full details of the test case that you have been able to provide.
    Any help much appreciated.
    Regards
    Marc Ludwig

  • Focus lost first ?

    i have 2 text fields, A and B. when i hit tab, focus travel from A to B, my question is which focus event occur first ? focus lost for A or focus gained for B ?

    i have a more complex problem, why i press the tab, the program won't fire the ket event? when i press enter, it fire the key event ? a sample code is provided and anyone can explain the result ?
    Ai got the focus
    key event fired
    Bi got the focus
    Ai lost the focus
    Ai lost the focus
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class test10 implements FocusListener, ActionListener, KeyListener
      private static JFrame frame;
      private static JPanel pane1;
      private static JTextField tfield1, tfield2;
      private static JTextField current = null;
      public test10()
        frame = new JFrame( "A frame" );
        frame.setSize( 100, 50 );
        pane1 = new JPanel();  
        tfield1 = new JTextField( "A", 5 );
        tfield1.setName( "A" );
        tfield1.addFocusListener( this );
        tfield1.addActionListener( this );
        tfield1.addKeyListener( this );
        tfield2 = new JTextField( "B", 5 );
        tfield2.setName( "B" );
        tfield2.setEnabled( false );
        tfield2.addFocusListener( this );
        tfield2.addActionListener( this );
        tfield2.addKeyListener( this );
        pane1.add( tfield1 );
        pane1.add( tfield2 );    
        frame.getContentPane().add( pane1 );
        frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
        frame.pack();
        frame.setVisible( true );
      public void keyPressed(KeyEvent e)
    System.out.println( "key event fired" );
        if(e.getKeyCode() == e.VK_TAB)
          if( current == tfield1 )
            tfield1.setEnabled( false );
            tfield2.setEnabled( true );
            tfield2.requestFocus();
          if( current == tfield2 )
            tfield2.setEnabled( false );
            tfield1.setEnabled( true );
            tfield1.requestFocus();
      public void keyTyped( KeyEvent e )
      public void keyReleased(KeyEvent e)   
      public void focusGained( FocusEvent fe )
        System.out.println( ((JTextField)fe.getSource()).getName() + "i got the focus" );
        current = (JTextField)fe.getSource(); 
      public void focusLost( FocusEvent fe )
        if( fe.getSource() == tfield1 )
          tfield2.setEnabled( true );
          tfield2.requestFocus();     
          tfield1.setEnabled( false );
          System.out.println( ((JTextField)fe.getSource()).getName() + "i lost the focus" );   
        if( fe.getSource() == tfield2 )
          tfield1.setEnabled( true );
          tfield1.requestFocus();  
          tfield2.setEnabled( false );  
          System.out.println( ((JTextField)fe.getSource()).getName() + "i lost the focus" );   
      public void actionPerformed( ActionEvent ae )
        if( ae.getSource() == tfield1 )
          tfield1.setEnabled( false );
          tfield2.setEnabled( true );
          tfield2.requestFocus();     
          System.out.println( ((JTextField)ae.getSource()).getName() + "i lost the focus" );   
        if( ae.getSource() == tfield2 )
          tfield2.setEnabled( false );          
          tfield1.setEnabled( true );
          tfield1.requestFocus();
          System.out.println( ((JTextField)ae.getSource()).getName() + "i lost the focus" );   
      public static void main( String[] args )
        test10 t = new test10();
    }

  • Preventing Focus Lost

    I am trying to stop a focus lost on a JTextField. I was not able to find anything on this in the Forum or searching.
    Basically, I want to prevent a user from leaving a text field when the data is invalid, so focus lost should only be granted when valid.
    I tried overriding .transferFocus(), but of course you can just click on another component.
    I did find something that works at times, but is very dangerous. I added a focus listener and did something like this:
                public void focusLost(FocusEvent e)
                    try
                    {                    Toolkit.getDefaultToolkit().getSystemEventQueue().getNextEvent();
                    catch (InterruptedException ex){}
                    requestFocus();
                }Calling this will remove the focus gained event after the focus lost and .requestFocus() can be called to regain focus.
    Anyone have any ideas?

    Check out the InputVerifier class.
    Or, you can also use a [url http://java.sun.com/docs/books/tutorial/uiswing/components/generaltext.html#filter]Document Filter to prevent invalid character from being entered the the text field.
    Or, you can use a JFormattedTextField.

  • In my haste i sent a message to "erase ipod touch" on find my iphone when iI lost my lost ipod touch. Can I reverse that? Anthony

    In my haste i sent a message to "erase ipod touch" on find my iphone when iI lost my lost ipod touch. Can I reverse that?
    Thanks in advance,
    dizzysaxy

    Sort of if you can get hold of the iPod before it is erased, turn wifi off, then backup the iPod, turn wifi on and let it erase. Then restore from backup.

  • As we were instructed I attempted to download the new Adobe Cloud to replace Adobe CS6 as it is about to expire.  It had been downloading for about an hour when I lost power due to a storm. It was only off 20 minutes. When it came back up it had stopped b

    As we were instructed I attempted to download the new Adobe Cloud to replace Adobe CS6 as it is about to expire.  It had been downloading for about an hour when I lost power due to a storm. It was only off 20 minutes. When it came back up it had stopped because my internet of course was also off. Now I have tried to do it again and it tells me “that number has already been approved and uploaded” However, it has not because I do not have the cloud programs yet. I still have my CS6 but I am not sure what to do from here. Can you assist with this please?

    After admittedly only a quick read the one thing you don't say is how you are trying to make this move.  Most people with moving library issues do it the wrong way.  Plenty of web sites tell you how to do it the wrong way.
    If the iTunes application is started before the drive with the library is fully mounted and awake iTunes will revert back to the internal drive.

  • Second Printed Page of a Report Is Corrupted As Well the Report View When Focus Is Returned To It

    I am having a problem with a report in Access 2010. The report detail has a linked subreport in it. I build a query dynamically for both the report and subreport. There is a form that builds the queries and then displays the report in Report View. Everything
    is displayed correctly. In this view I have a command button that will print the report using “DoCmd.RunCommand acCmdPrint.”The printed report’s first page is correct. The second page has #error for all the fields for next record detail and that is it. At
    this point, there are still multiple records to print. When focus is returned to the Print View, it is corrupted and usually freezes.
    If after the Report View is displayed, I right click on the header and choose to display the Print Preview, all pages are displayed correctly. If I right click again, and select print, all pages are printed correctly, and the Report View is not corrupted.
    To see if I had corrupted the database, I imported everything into an empty database. After compiling the code, the behavior did not change at all.
    Once I place the database into production, everything will be driven by command buttons on the forms and reports so the left-click drop-down menus or any ribbons will not be available.
    Does anyone know what is happening?
    Thanks, in advance.

    Hi Ray,
    I failed to reproduce this issue in my test environment (Access 2013).
    Steps:
    #1 Create a table with the attachment field, add multiple records
    #2 Create a report with the table
    #3 Click Print Preview of the report, it worked correctly
    Can you also reproduce this issue in a newly created database, if no, I will suspect that issue is related to the specific database file (data issue or database is corrupted). You could use the link below to compact and repair the database.
    Compact and repair a database
    If the methods above do not work, it would be helpful if you could share us a simple demo to reproduce this issue. Due to privacy issues, I will also suggest you submitting a professional support incident to get the 1-1 support service so that Microsoft
    engineers can work closely with you to resolve this issue.
    Best Regards,
    Edward
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

Maybe you are looking for

  • BIP report security from Dashboard to Publisher is not working

    Hi , I created a BIP report(.xdo) and placed it on Dashboard as a link . As admin , I can see the report . As a user , I am able to get into publisher but not able to see the report . Iam getting the below error message . Error : Unauthorized Access:

  • MacBook pro [mid 2012] freezes

    Hi Guys, I bought brand new MacBook pro 2012 (no-retina) from a local store, and it came with 4GB of memory. I upgraded to 8GB and since upgrading it started freezing regulary 1-3 times on daily basis. It freezes on Photoshop, Illustrator, Chrome, iT

  • Can't start configtool

    Hello there, i can't start the configtool in my Slim-Sneak Edition. The following error do always accrue! Exception in thread "main" java.lang.NoClassDefFoundError: com/sap/engine/offlin e/OfflineToolStart Program terminated abnormally The Java_HOME

  • Upgrade price changed when picking up from store.

    I ordered a phone online and selected the pickup from store option.  I was given a total up grade price of $64.73 which included the phone and upgrade fee.  I entered my credit card information online and received a purchase reciept.  The page said a

  • Unable to log into the SAP River RDE environment (HTTP Status 405)

    Hi All, Is anyone else facing this issue as well? I have previously been able to access the River RDE, but now I am unable to login. From the Hanatrial cockpit, when I access my RDE subscription, and click on the rde link, I get an error message as f