Only see cell value in JTable when press escape

Hello,
I've a JTable with his own CellEditor en Renderer ( to handle Float values). When I do setValueAt(object, row, col) on the table I don't see the value in it. I only see it when I press escape.
Can somebody explain me why?
thanks,
dries

The problem is that in the dialog with the JTable in have to press F8 to get measure something through a serial connection. I recieve the
measurement and I want to display this in the JTable. So i call the setValueAT() method to display it. I don't call this method within the customeditor. My Custom editor looks like this:
DefaultCellEditor floatEditor =
                new DefaultCellEditor(floatJTextField)
                    public Object getCellEditorValue()
                        return new Float(floatJTextField.getFloat());
                    public boolean stopCellEditing()
                        try
                            if (checkTolerances(((Float) getCellEditorValue()).floatValue()))
                                //aflezenBalansBtn.setEnabled(true);
                                getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("F8"), "AflezenBalans");
                                getRootPane().getActionMap().put("AflezenBalans", new AflezenBalansAction(new Integer(KeyEvent.VK_F8)));                                                              rowIndex++;
                                aflezenBalans();
                                return super.stopCellEditing();
                            else
                                JOptionPane.showMessageDialog(getParent(), "Buiten toleranties", "Input error", JOptionPane.ERROR_MESSAGE);
                                return false;
                        catch (ApplicationException e)
                            e.printStackTrace();
                            return false;
                };Any help?
Thanks,
Dries

Similar Messages

  • Why do I only see grayscale values when I add color from color picker? This happens occasionally, but I don't know what triggers it.

    Why do I only see grayscale values when I add color from color picker? This happens occasionally, but I don't know what triggers it.

    We can't know. You have not provided any system information, not told us what version of AE, details about your artwork, color management and whatnot.
    Mylenium

  • Picture can not be resized to fit the screen, so i can only see half of my face when use it as wallpaper!! Suckss!!

    picture can not be resized to fit the screen, so i can only see half of my face when use it as wallpaper!!  How can I change it??

    There's a bug with the wallpaper. One thing that helps a bit, go to the photos app, find your pic, 'send' it to be wallpaper. You have a bit more control although not all the function you're used to.
    No idea when or if Apple will fix it.

  • I have all my alert on for email but I only see that I receive any when I open the email box. How do I fix that?

    I have all my alert on for email but I only see that I receive any when I open the email box. How do I fix that?

    Did you change the ID in Settings>iTunes & App Stores>Apple ID? Tap the old ID and sign out and then sign in with the new one. If not running iOS 6 it will be Settings>Stores>Apple ID.

  • Touble getting cell values from jTable

    Hi everybody, I need some hepl to understand this problem.
    I have jtable and I�m trying to get the values from the cells (first in the jOption panel then to jLabel and to jTextFields).
    All cell values are shown perfectly in the JOptionPanel.
    But I can�t get any values to the jLabel from the first column(0) no matter what row I press from the firts column.
    It gives me this error
    Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: java.lang.Integer
         at taulukko3.FTaulukko3.jTable1_mouseClicked(FTaulukko3.java:163)Here is my code where I think the problem is:
    public void jTable1_mouseClicked(MouseEvent e) {
       JOptionPane.showMessageDialog(this,jTable1.getValueAt(jTable1.getSelectedRow(),jTable1.getSelectedColumn()));
          try{
          int valittusarake = jTable1.getSelectedColumn();
           String tulos= "";
           if (valittusarake == 0) {
             tulos = (String) jTable1.getValueAt(jTable1.getSelectedRow(),
                                                      jTable1.getSelectedColumn());
            jLabel1.setText(tulos);
           if (valittusarake == 1) {
             tulos = (String) jTable1.getValueAt(jTable1.getSelectedRow(),
                                                       jTable1.getSelectedColumn());
             jTextField1.setText(tulos);
           if (valittusarake == 2) {
             tulos = (String) jTable1.getValueAt(jTable1.getSelectedRow(),
                                                       jTable1.getSelectedColumn());
             jTextField2.setText(tulos);
    }

    Hi everybody
    I got it workin by making this change to my code:
          if (valittusarake == 0) {
             Object tulos1 = jTable1.getValueAt(jTable1.getSelectedRow(),jTable1.getSelectedColumn());
             jLabel1.setText(tulos1.toString());
          }

  • Hiding a cell value in Jtable

    Is it possible to hide a cell value in a JTable?. The value should be present in the JTable but just hidden
    tnx

    Yes, there are a few ways to do this. I'm sure there are others, but here are 2 quick ways:
    1. When the cell value (Object ) is being rendered, it's toString() method is called. Create a subclass of whatever Object you are using in cells and override the toString() method.
    2. Create you own cell renderer and then you can renderer the contents of a cell however you wish.
    Regards,
    Muel.

  • An image comes on my screen, but I can only see the first page.  When I try to print, I get a blue question mark and can't print.

    Recently when I pull up a multi-page document from an internet site, I can only see the first page.  I can't scroll through it.  When I try to print, I get a big blue questionmark.  What's the solution to this, please?

    Thank you so much!! So simple, yet so effective! Am happy!

  • I can only see numbers instead of contacts when i send imessages

    When i send iMessage to one of My contacts, i can only see this contacts number instead of his namne at the top

    From the application's menu bar, select
              Window ▹ Zoom
    Some applications don't have this menu command.

  • How to get current row value from table when press the submit button

    Hi,
    I want to get the current row value of SuccessionPlanId which is one of the column in a advanced table.
    I created one button (created using personalization, action fired thru CO)in the table as column, so each row having one button, if i press the first row's button means then i want to fetch the first row's SuccessionPlanId and if it is 3rd means then i want to get the value of third row's value.
    How to do it in controller extension?
    Please reply soon, its urgent.
    Thanks in advance,
    SAN

    Pratap,
    Yes, I tried with 'delete' button which is seeded one.
    For this, our code using row reference is working too fine. it throws exact SuccessionPlanId value of corresponding row.
    I created MessageStyledText, but here i need to give text value right, then only it 'll appear in the page.
    Instead i created one image and fired explicitly from the controller processRequest method.
    But the same problem remains..
    here my code:
    public void processRequest(OAPageContext pageContext, OAWebBean webBean){
    super.processRequest(pageContext, webBean);
    OAButtonBean oabb = (OAButtonBean)webBean.findChildRecursive("XXSubmit");
    FireAction action = new FireAction("XXSubmit");
    oabb.setAttributeValue(UIConstants.PRIMARY_CLIENT_ACTION_ATTR, action);
    OAImageBean oaib=(OAImageBean)webBean.findChildRecursive("XXSubmitImage");
    oaib.setFireActionForSubmit("XXSubmitImage", null, null, true);
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean){
    if("XXSubmitImage".equals(pageContext.getParameter("event"))){
    String succIdI="";
    String rowRefI = pageContext.getParameter(OAWebBeanConstants.EVENT_SOURCE_ROW_REFERENCE);
    if(rowRefI != null && !("".equalsIgnoreCase(rowRefI ))){
    PerSuccPlanSearchVORowImpl rowI = (PerSuccPlanSearchVORowImpl)oaam.findRowByRef(rowRefI);
    if(rowI != null)
    succIdI=rowI.getAttribute("SuccessionPlanId").toString();
    }else{
    throw new OAException("Row is null");
    throw new OAException(succIdI, OAException.INFORMATION);
    }else{
    super.processFormRequest(pageContext, webBean);
    If i run the page using this controller, it throws exception without any value, because for 'succIdI' i initialized without any string.
    Can you please suggest me how to solve?

  • Set focus on particular cell in a JTable when using TableModel.

    I want to implement validation in my table cells. I the value does not satisfy certain condition then the focus should remain on the same cell and the user should be asked to enter valid value.
    I am using TableModel and i have tried implementing validation in the setValueAt() method some thing like this.
    setValueAt method of my table model.
    public void setValueAt(Object value, int row, int col){
    if(datalist.size()>row){
    OutboundFieldMappingObj obj=(OutboundFieldMappingObj)datalist.get(row);
    String str=null;
    switch (col){
    case 0:
    str=Validator.getValidNumber((String)value,1,999999999L);
    obj.setFiledName(str);
    break;
    case 1:
    str=Validator.getValidString((String)value,128,false);
    obj.setFiledClass(str);
    break;
    case 2:
    obj.setSource((String)value);
    break;
    fireTableCellUpdated(row, col);
    But this doesn't solve the issue. In this case after entering the value when i click on some other cell then it shows me a message stating that the value is invalid but it doesn't takes the focus back to same cell. The focus is shifted to the cell where i have clicked.
    Please help me out in resolving the issue.
    I have added the code of my validator class at the bottom if any one needs to have a look at it.
    Thanks
    Validator class
    public class Validator {
    public Validator() {
    public static String getValidString(String val, int max, boolean upper) {
    if (val == null || val.equals("")) {
    showErrorMsg("The cell can not be left blank");
    return " ";
    if (val.length() > max) {
    val = val.substring(0, max);
    showErrorMsg("String value to long. Truncated to " + max +" characters.");
    if (upper) {
    val = val.toUpperCase();
    return val;
    public static String getValidNullableString(String val, int max, boolean upper) {
    if (val == null) {
    return null;
    if (val.length() > max) {
    val = val.substring(0, max);
    showErrorMsg("String value to long. Truncated to " + max +" characters.");
    if (upper) {
    val = val.toUpperCase();
    return val;
    public static String getValidNumber(String number, int min, long max) {
    try {
    long num = Long.parseLong(number);
    if (num < min) {
    showErrorMsg("Number less than mininum value of " + min + ".");
    return "" + min;
    if (num > max) {
    showErrorMsg("Number greater than maximum value of " + max +".");
    return "" + max;
    return number;
    } catch (Exception x) {
    showErrorMsg("Invalid Entry. Number Expected.");
    return "0";
    // return "";
    public static boolean getValidNumber(String number) {
    try {
    Integer.parseInt(number);
    return true;
    } catch (Exception x) {
    showErrorMsg("Invalid Entry. Number Expected.");
    return false;
    // return "";
    public static void showErrorMsg(String message) {
    JOptionPane.showMessageDialog(new java.awt.Frame(), message,
    "Invalid Value!",
    JOptionPane.ERROR_MESSAGE);
    public static boolean validString(String str) {
    if (str != null && str.length() > 0) {
    return true;
    return false;
    }

    You need to create a custom editor. Something like this:
    http://forums.sun.com/thread.jspa?forumID=57&threadID=642364
    If you need further help then you need to create a [Short, Self Contained, Compilable and Executable, Example Program (SSCCE)|http://homepage1.nifty.com/algafield/sscce.html], that demonstrates the incorrect behaviour.
    Don't forget to use the Code Formatting Tags so the posted code retains its original formatting. That is done by selecting the code and then clicking on the "Code" button above the question input area.

  • Firefox opens, but I can only see it in my toolbar when I put my curser over it

    My Firefox opened this morning, full screen, but now it won't go full screen. The only way I can see it is by putting my curser over the icon in my toolbar. I've tried uninstalling and re-installing Firefox, but that didn't help either. When I've clicked on the icon, it seems to go over to the right side of my screen and get "lost".

    Could you try the trick described in this thread and see whether it works for you: [https://support.mozilla.org/en-US/questions/941896 When I go to open firefox it shows up on my tool bar but not on my screen where is it?]
    The backup plan is to delete a settings file that stores the last-used window position. Since that also deletes all your toolbar customizations, let's set that aside as a last resort.

  • I only see a blank white screen when I try to open the itunes store.

    I have an iMac running OS X 10.8.4 and cannot view the itunes store.  My library shows but the store is a blank white screen.  On my macbook at home with the same system it works fine.

    Hi Jim,
    I am having the same problem so I followed your advice and signed out, restarted, and signed back in. It let me look at my account in the itunes store but when I try to leave my account and go to the actual itunes store, it is still just a blank white screen. There are home, music, movies, etc. tabs. Movies and tv shows both have a black screen but the rest are white. Do you have any other suggestions?

  • I only see portions of my images when opening them in Photoshop CS6

    Opening the images (.psd and .NEF) in camera raw presents no problems. The problem occurs when I then select OPEN to open them in Photoshop.

    This is a GPU/driver problem.  Update your drivers.
    You can also turn off "use graphics processor" in preferences/performance.  But doing this you will loose some functions of OpenGL.

  • How do I get Integer in JTable cell to be selected when edit using keyboard

    I have some cells in a JTable, when I double-click on the cell to edit it the current value (if any) is selected and is replaced by any value I enter, which is the behaviour I want. But when I use the keyboard to navigate to the cell and start editing, new values are added to the end of the current value which is not what I want.
    I have created my own IntegerCellEditor (see below) and added a focus event or the textfield used when editing to select all the current text but it has no effect, any ideas please ?
    public class IntegerCellEditor extends DefaultCellEditor
        public IntegerCellEditor( JTextField textfield )
            super( textfield );    
            //Ensure old value is always selected, when start editing
            ((JTextField)getComponent()).addFocusListener(new FocusAdapter()
                    public void focusGained(FocusEvent fe){
                        ((JTextField)getComponent()).selectAll();
            ((JTextField)getComponent()).setHorizontalAlignment(JTextField.RIGHT);
         * Return as Integer (because delegate converts values to Strings).
        public Object getCellEditorValue()
            return Integer.valueOf((String)delegate.getCellEditorValue());
    }

    But when I use the keyboard to navigate to the cell and start editing,
    new values are added to the end of the current value which is not what I want.How does the use know that typing will replace the text and not append? Usually if text is to be deleted, it is highlighted to give the user a visual cue.
    Here is a renderer that does this, in case your interested:
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=752727

  • Help with editing a cell in a JTable. DESPERATE

    Hi! Is there someone out there that could help with some source code for editing a cell in my JTable when I run it as an applet??
    It works fine when I run it as an application.
    I manage to select the row and write a number in it, but I can't get out of the cell (it seems that the program stops??). I want to enter an integer in a cell and when I click enter or with the mouse in an other cell the value that I enter should update some other cell( multiply the entered value with some fixed number and update a cell in a second coloumn)
    I am really desperate now..... I have thought about using a MouseListener....
    I am using a tablemodel that is from AbstractTableModel.

    Are you using some cell editors?
    While converting inside them, you might be getting some exceptions (like parseexception)which is stopping you from proceeding further.
    Are you using your own tablemodel with custom datatypes?
    Hope this helps,
    Ramkumar

Maybe you are looking for

  • How do I upgrade os x 10.6.8 with a 1gb mac mini

    how do I upgrade os x 10.6.8 with a 1gb mac mini to something higher (eg LION 10.7)?

  • IP addresses are going to be changed for SharePoint farm servers(App, WFE, DB)

    Hello, We had multiple SharePoint Farms, and we would like to changes the IP address of all the servers in farm(because of changing the Datacenter). will I get any issues, if, how can I take it forward. Need suggestions. Thank You NARLA

  • IDOC-XI-JDBC: mapping error

    Hi sap gurus...         I had a problem in IDOC mapping to JDBC. If any body have mapping template or any blog.. related to MATMAS.. please help me.. I don't know how to map the idoc structure to JDBC structure.. points will be given immediately.. Ku

  • Add new line in Journal Voucher by DI exception

    Dears, When I create the Journal Vourcher by DI, I got the exception when I execute the following function JournalVoucher.JournalEntries.Add() After search from forum, some people suggest that I should reinstall DIAPI or delete the SM_OBS_DLL folder.

  • Printer doesn't operate correctly w/firefox

    printer is very slow when using firefox, but not when using internet explorer. == This happened == Every time Firefox opened == i installed new hpf4400 deskjet printer