Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/364.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
javax.swing.JTable;记录验证导致性能问题_Java_Swing_Jtable - Fatal编程技术网

javax.swing.JTable;记录验证导致性能问题

javax.swing.JTable;记录验证导致性能问题,java,swing,jtable,Java,Swing,Jtable,javax.swing.JTable;记录验证导致性能问题 我正在尝试使用for循环验证JTable中的每个记录,当JTable有很多记录时,这需要花费很多时间,请建议我更好的方法。 请查找下面的示例代码片段。提前感谢 JTable tblReceipt = getTblReceive(); tblReceipt.removeEditor(); boolean allLineCheck = t

javax.swing.JTable;记录验证导致性能问题 我正在尝试使用for循环验证JTable中的每个记录,当JTable有很多记录时,这需要花费很多时间,请建议我更好的方法。 请查找下面的示例代码片段。提前感谢

            JTable tblReceipt = getTblReceive();
                    tblReceipt.removeEditor();
                    boolean allLineCheck = true;


                    for (int row = 0; row < tblReceipt.getRowCount(); row++)
                    {
                        String issueQty = (String) tblReceipt.getValueAt(row, 5);
                        String receiveQty = (String) tblReceipt.getValueAt(row, 6);
                        String itemNo = (String) tblReceipt.getValueAt(row, 0);
                        double dIssueQty = Common.toDouble(issueQty);
                        double dReceiveQty = Common.toDouble(receiveQty);


                        double qty = 1.0;// initial one quantity
                        qty = qty / Math.pow(10, itmDecimal);

                        if (dReceiveQty > dIssueQty)
                        {
                            getProgressBar().setVisible(false);
                            Common.displayConfirmDialog()

                            // Qty exceeds the available qty


                        }
                        else if (itmDecimal == 0 && (dReceiveQty >= 0.0000001 && dReceiveQty <= 0.1))
                        {

                            Common.displayConfirmDialog();


                            // Invalid quantity

                            return false;
                        }

                    }

如果移动双数量=1.0;/,会怎么样初始一个数量=数量/Math.pow10,具体为;不在for循环中?多少是多少?1000? 1000000? 您是否使用自己的表格模型?是的,我可以移动双倍数量=1.0;//初始一个数量qty=qty/Math.pow10,itmDecimal和10000条记录将在那里maxYes Im使用我自己的表格模型A可以帮助我们隔离问题。