Getting Problem in retrieving values from JTable

Hi Guys,
Suppose i clicked in cell in a table to edit it and done some entry in it and without leaving that cell ( means focus is on that cell only) i clicked one button.
button prints table data on console.
now problem is the value in focused cell is coming as null or wht i previously return.
that means unless i m not leaving a cell the Jtable is not taking that value.
how could i overcome this problem
thanks in advance

Use this:table.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE);The editor will be closed as soon as the table loses focus.

Similar Messages

  • Get , store and retrieve values from JComboBox, JT.......

    please can you show me how to collect informations from some JComponents like JComboBox, JList , JTextField, JTextArea etc and store them on clicking on a single button and also retreiving them by clicking on another single button

    below are some functions that u can use:
    JComboBox: getSelectedItem()
    JList: getSelectedValue()
    JTextField, JTextArea: getText()
    basically u need to have button, add an action listener for the button, and store the value using the above functions when the button is clicked.
    hth.

  • Reading values from JTable

    I have som problems reading the values from JTable. the user enters a number in the table, but some cells are empty. I want to store the values in an int array, and if the user has not filled a cell it is supposed to be set as zero. Now I cant seam to get it right.
    I get the error message: Exception in thread "AWT-EventQueue-0" java.lang.NumberFormatException: null
    It is for the code. Integer intObj = new Integer(str);[/u
    int[] tmp = new int[brettStorelse * brettStorelse];
    for (int i = 0; i < brettStorelse; i++) {
         for (int j = 0; j < brettStorelse;j++) {
              String k = String.valueOf(j+i);
              int l = Integer.parseInt(k);
              if (sudokuTabell.getValueAt(i, j) != null) {
                   String str = (String) sudokuTabell.getValueAt(i+1, j+1);
                   Integer intObj = new Integer(str);
                   tmp[l] = intObj.intValue();
                   System.out.println(tmp[l]);
              } else {
                   tmp[l] = 0;

    What are you doing to prevent the user from entering values in the table that are not parseable? Seems like you should be doing the below.
    int[] tmp = new int[brettStorelse * brettStorelse];
    for (int i = 0; i < brettStorelse; i++) {
         for (int j = 0; j < brettStorelse;j++) {
              String k = String.valueOf(j+i);
              int l = Integer.parseInt(k);
              if (sudokuTabell.getValueAt(i, j) != null) {
                   String str = (String) sudokuTabell.getValueAt(i+1, j+1);
                            try {
                                tmp[l] = Integer.parseInt (str);
                            catch (NumberFormatException e){
                                 tmp[l] = 0;
                   System.out.println(tmp[l]);
              } else {
                   tmp[l] = 0;
    }

  • I am facing problem while reading values from properties file ...i am getting null pointer exception earlier i was using jdeveloper10g now i am using 11g

    i am facing problem while reading values from properties file ...i am getting null pointer exception earlier i was using jdeveloper10g now i am using 11g

    hi TimoHahn,
    i am getting following exception in JDeveloper(11g release 2) Studio Edition Version 11.1.2.4.0 but it works perfectly fine in JDeveloper 10.1.2.1.0
    Root cause of ServletException.
    java.lang.NullPointerException
    at java.util.PropertyResourceBundle.handleGetObject(PropertyResourceBundle.java:136)
    at java.util.ResourceBundle.getObject(ResourceBundle.java:368)
    at java.util.ResourceBundle.getString(ResourceBundle.java:334)
    at org.rbi.cefa.master.actionclass.UserAction.execute(UserAction.java:163)
    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:431)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:236)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
    at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
    at java.security.AccessController.doPrivileged(Native Method)
    at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
    at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
    at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
    at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
    at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)

  • Retrieving values from a table in ADF

    Hi All,
    Can any one give me the code or an example as how to retrieve the values associated with the table in jspx page.
    I am working in ADF10.1.3.
    Thanks,

    Hi,
    I am using ADF10.1
    I have a table with multi selection in my jspx page.
    I have to get the table particular row and using that need to get other values associated with the table.
    I have used the floowing code..but this is not functioning properly
    SelectedRowSet = this.getTable1().getSelectionState().getKeySet();
    rowSetIter = selectedRowSet.iterator();
    // Get the Selected Row Values from
    if (selectedRowSet.size() > 0)
    for (int counter = 0; counter < selectedRowSet.size(); counter++)
    int index = (Integer) rowSetIter.next();
    JUCtrlValueBindingRef currentRow =
    (JUCtrlValueBindingRef) getTable1().getRowData(index);
    Row row = currentRow.getRow();
    if (row!=null)
    variable name = ((String) row.getAttribute());
    Debugger is raising an exception at JUCtrlValueBindingRef line.
    Do share some ideas on it.
    Thanks,

  • Retrieving values from Database in Excel Task Pane App

    So far,
    I created a website with a database on Azure, I then published my App to Azure. My problem is that I'm not sure how I retrieve values from the database (in SQL: SELECT * FROM EXAMPLE_TABLE WHERE date = str). If someone could provide me with sample code,
    that would be amazing! :D
    It would also be very helpful if anyone knew a method to automatically update the database using information from a xml stream on another website, once a day.
    Thank you!

    Hi,
    >> My problem is that I'm not sure how I retrieve values from the database
    You can use jquery ajax call to call your webserivce or REST API, which will query the database and return a json result.
    Sample:
    Apps for Office: Create a web service using the ASP.NET Web API
    >> It would also be very helpful if anyone knew a method to automatically update the database using information from a xml stream on another website
    For the database sync-up question, I suggest you posting them on the forums like SQL Server Forum.
    Thanks for your understanding.
    Best Regards
    Lan
    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.

  • Facing Problem with passing Values from One report to another

    Hi,
    I am Hemanth, I have developed 2 reports. Firast Report High Level Summary, Secong is detailed. First report is developed using Union(4 union) , I am having 4 columns. The report is generating the data. I have used Navigation option on Client Column to move on to Second report. In Second report with in Filter i am using Prompted option. Due to some problem, the client value from first report is not passing to the second one. The second report is getting generated for all the clients.
    Normally i have used this Navigate option in other reports and that works fine. I have even tested with Union, it works. This time it is giving some trouble.
    Please, let me know whats going wrong.
    Thanks for the help.

    sorry for the late updation.
    My First Report, Summary level is a Pivot Table.
    I tried the same report with Table option, the value is passing correctly.
    Is there a way to get rid of this situation using Pivot table.
    Thanks for your help.
    below is the original request.
    Hi,
    I am Hemanth, I have developed 2 reports. Firast Report High Level Summary, Secong is detailed. First report is developed using Union(4 union) , I am having 4 columns. The report is generating the data. I have used Navigation option on Client Column to move on to Second report. In Second report with in Filter i am using Prompted option. Due to some problem, the client value from first report is not passing to the second one. The second report is getting generated for all the clients.
    Normally i have used this Navigate option in other reports and that works fine. I have even tested with Union, it works. This time it is giving some trouble.
    Please, let me know whats going wrong.
    Thanks for the help.

  • How to get the default selection color from JTable

    Hi, there,
    I have a question for how to get the default selection color from JTable. I am currently implementing the customized table cell renderer, but I do want to set the selection color in the table exactly the same of default table cell renderer. The JTable.getSelectionBackgroup() did not works for me, it returned dark blue which made the text in the table unreadable. Anyone know how to get the window's default selection color?
    Thanks,
    -Jenny

    The windows default selection color is dark blue. Try selecting any text on this page. The difference is that the text gets changed to a white font so you can actually see the text.
    If you don't like the default colors that Java uses then use the UIManager to change the defaults. The following program shows all the properties controlled by the UIManager:
    http://www.discoverteenergy.com/files/ShowUIDefaults.java
    Any of the properties can be changed for the entire application by using:
    UIManager.put( "propertyName", value );

  • EVDRE error "encountered problem when retrieving data from webserver"

    Hi,
    in a EVDRE we always get the error "encountered problem when retrieving data from webserver"
    When analysing this further we noticed this is always generated when a base member is selected in the CV and the expansion on the row for this dimension is has one of the following expansion settings:
    DEP
    ALL
    NOEXPAND
    if we select SELF, the error disappears again and the EVDRE works fine again ... is this normal behavior?
    there is no problem with application nor dimension.
    D
    solved it

    Note that the keyword "ALL" does not include the member itself. This may cause some confusion, but as Harish implies, when you select a base member it finds no matches if your memberset is "ALL".
    If you want to design a report to handle the user moving back and forth between base and non-base members in their CV, you either need to include SELF,ALL or SELF,DEP, or something similar....
    OR you need to get a little fancier, and use EVPRO to look and see if the CV member is base -- evpro(app,member,"CALC") -- and then use some conditional logic in Excel to choose the correct expansion options. If Calc=N, use Self, otherwise use SELF,DEP or whatever you choose. This can be a bit tricky if you then want the user to be able to drill down in the report (especially if you want the workbook option to insert add'l rows on the expansion, rather than replace), but it's all possible.

  • Retrieve values from a HTML table !!!

    Hi.
    How can i retrieve values from a HTML table using javascript ?
    I´m trying to use the command "document.getElementsByTagName" without success.
    Thanks in advance.
    Eduardo

    Hi, Deepu.
    I´m still with trouble in retrieving the value in HTML.
    In debug the C_CELL_ID seems to be correctly updated but
    when using the command "document.getElementById" the value is always "null".
    I implemented in the method DATA_CELL the code :
      if i_x = 3 and i_y = 2.
      C_CELL_ID             = 'zs'.
      C_CELL_CONTENT = 10. 
      endif.
    And in HTML :
    var ztest = document.getElementById('zs');
    alert(ztest);
    Could you help me please.
    Many regards
    Eduardo S.
    Message was edited by: Eduardo   Silberberg

  • Retrieving values from a table

    Hi all,
    I need to retrieve values from CSKS-KOSTL for values containing the pattern entered by the user. For example, if the user enters 1, need to retrieve all the KOSTL values starting with 1. But when i write a SELECT statement mentioning where kostl in '1', it is ignoring all the values like (0000001, 00001034, 0012334, and others). Only values starting with 1 is only retrieved as this is a character field and due to conversion routine, zeroes are prefixed while storing in the database.
    Could any one let me know how to retrieve the values from the database in this situation?

    If you want to use IN operator in your where clause then you should define a range variable(R_KOSTL) which refers to CSKS=KOSTL and populate the range as below
    R_KOSTL-SIGN = 'I'.
    R_KOSTL-OPTION = 'CP'.
    R_KOSTL-LOW = '1*'.
    APPEND R_KOSTL.
    and then write your select statement as .... WHERE kostl IN r_kostl.
    The approach suggested by Amit should also work fine.
    Thanks
    Kiran

  • How to retrieve value from xml file

    hi all,
    can somebody pls tell me how to retrieve value from xml file using SAXParser.
    I want to retrieve value of only one tag and have to perform some validation with that value.
    it's urgent .
    pls help me out
    thnx in adv.
    ritu

    hi shanu,
    the pbm is solved, now i m able to access XXX no. in action class & i m able to validate it. The only thing which i want to know is it ok to declare static ArrayList as i have done in this code. i mean will it affect the performance or functionality of the system.
    pls have a look at the following code snippet.
    public class XMLValidator {
    static ArrayList strXXX = new ArrayList();
    public void validate(){
    factory.setValidating(true);
    parser = factory.newSAXParser();
    //all factory code is here only
    parser.parse(xmlURI, new XMLErrorHandler());     
    public void setXXX(String pstrXXX){          
    strUpn.add(pstrXXX);
    public ArrayList getXXX(){
    return strXXX;
    class XMLErrorHandler extends DefaultHandler {
    String tagName = "";
    String tagValue = "";
    String applicationRefNo = "";
    String XXXValue ="";
    String XXXNo = "";          
    XMLValidator objXmlValidator = new XMLValidator();
    public void startElement(String uri, String name, String qName, Attributes atts) {
    tagName = qName;
    public void characters(char ch[], int start, int length) {
    if ("Reference".equals(tagName)) {
    tagValue = new String(ch, start, length).trim();
    if (tagValue.length() > 0) {
    RefNo = new String(ch, start, length);
    if ("XXX".equals(tagName)) {
    XXXValue = new String(ch, start, length).trim();
    if (XXXValue.length() > 0) {
    XXXNo = new String(ch, start, length);
    public void endElement(String uri, String localName, String qName) throws SAXException {                    
    if(qName.equalsIgnoreCase("XXX")) {     
    objXmlValidator.setXXX(XXXNo);
    thnx & Regards,
    ritu

  • Problems with retrieving data from tables with 240 and more records

    Hi,
    I've been connecting to Oracle 11g Server (not sure exact version) using Oracle 10.1.0 Client and O10 Oracle 10g driver. Everything was ok.
    I installed Oracle 11.2.0 Client and I started to have problems with retrieving data from tables.
    First I used the same connection string, driver and so on (O10 Oracle 10g) then I tried ORA Oracle but with no luck. The result is like this:
    I'm able to connect to database. I'm able to retrieve data but from small tables (e.g. with 110 records it works perfectly using both O10 and ORA drivers). When I try to retrieve data from tables with like 240 and more records retrieval simply hangs (nothing happens at all - no error, no timeout). Application seems to hang forever.
    I'm using Powerbuilder to connect to Database (either PB10.5 using O10 driver or PB12 using ORA driver). I used DBTrace, so I see that query hangs on the first FETCH.
    So for the retrievals that hang I have something like:
    (3260008): BIND SELECT OUTPUT BUFFER (DataWindow):(DBI_SELBIND) (0.186 MS / 18978.709 MS)
    (3260008): ,len=160,type=DECIMAL,pbt=4,dbt=0,ct=0,prec=0,scale=0
    (3260008): ,len=160,type=DECIMAL,pbt=4,dbt=0,ct=0,prec=0,scale=1
    (3260008): ,len=160,type=DECIMAL,pbt=4,dbt=0,ct=0,prec=0,scale=0
    (3260008): EXECUTE:(DBI_DW_EXECUTE) (192.982 MS / 19171.691 MS)
    (3260008): FETCH NEXT:(DBI_FETCHNEXT)
    and this is the last line,
    while for retrievals that end, I have FETCH producing time, data in buffer and moving to the next Fetch until all data is retrieved
    On the side note, I have no problems with retrieving data either by SQL Developer or DbVisualizer.
    Problems started when I installed 11.2.0 Client. Even if I want to use 10.0.1 Client, the same problem occurs. So I guess something from 11.2.0 overrides 10.0.1 settings.
    I will appreciate any comments/hints/help.
    Thank you very much.

    pgoel wrote:
    I've been connecting to Oracle 11g Server (not sure exact version) using Oracle 10.1.0 Client and O10 Oracle 10g driver. Everything was ok.Earlier (before installing new stuff) did you ever try retrieving data from big tables (like 240 and more records), if yes, was it working?Yes, with Oracle 10g client (before installing 11g) I was able to retrieve any data, either it was 10k+ records or 100 records. Installing 11g client changed something that even using old 10g client (which I still have installed) fails to work. The same problem occur no matter I'm using 10g or 11g client now. Powerbuilder hangs on retrieving tables with more than like 240 records.
    Thanks.

  • 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());
          }

  • OO ABAP having problems retrieving value from screen dropBox field

    Hi,
    I am a new in ABAP, and need some advice.
    I have a class and in its definition I  have class-data: dropBox (same name as in screen) field from the screen. When I create a instance of a class and fill with data dropBox. data is populated properly using F4IF_INT_TABLE_VALUE_REQUEST method. But I can not retrieve the selected value. In screen dropBox field 'conversion exit' is set to ALPHA.
    Tried to do it without a class it works, and I can get data.
    Question is, can I do it using a class the way I explaining at the beginning of discussion.
    Am I missing something?
    Thanks,
    Aivaras

    It is not possible to have screen field attribute and use it. Solved my problem of returning value by increasing the value of Defined length on screen field.

Maybe you are looking for