You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by tv...@apache.org on 2009/09/11 16:05:45 UTC

svn commit: r813838 - /incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/stocktracker/StockTracker.java

Author: tvolkert
Date: Fri Sep 11 14:05:44 2009
New Revision: 813838

URL: http://svn.apache.org/viewvc?rev=813838&view=rev
Log:
Fixed small bug in stock tracker - was trying to insert new rows in the index specified by their symbol order as opposed to letting the table data determine the appropriate index

Modified:
    incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/stocktracker/StockTracker.java

Modified: incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/stocktracker/StockTracker.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/stocktracker/StockTracker.java?rev=813838&r1=813837&r2=813838&view=diff
==============================================================================
--- incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/stocktracker/StockTracker.java (original)
+++ incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/stocktracker/StockTracker.java Fri Sep 11 14:05:44 2009
@@ -326,14 +326,15 @@
     private void addSymbol() {
         String symbol = symbolTextInput.getText().toUpperCase();
         if (symbols.indexOf(symbol) == -1) {
-            int index = symbols.add(symbol);
+            symbols.add(symbol);
 
             List<StockQuote> tableData = (List<StockQuote>)stocksTableView.getTableData();
             StockQuote stockQuote = new StockQuote();
             stockQuote.setSymbol(symbol);
-            tableData.insert(stockQuote, index);
+            int index = tableData.add(stockQuote);
 
             stocksTableView.setSelectedIndex(index);
+            System.out.println(index);
         }
 
         symbolTextInput.setText("");