Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4097945

The java.awt.swing.JTable selection does not work properly

    XMLWordPrintable

Details

    • 1.2fcs
    • sparc
    • solaris_2.6
    • Verified

    Description



      Name: akC57697 Date: 12/08/97


       The java.awt.swing.JTable selection does not work properly.
       JTable.getSelectedRowCount() may returns value > then
       JTable.getRowCount().
       
       --------------8-<-----------------------------------
       import java.awt.swing.JTable;
       import java.awt.swing.table.*;
       
       public class JTableBug {
           public static void main(String s[]) {
             String data[][] = {{"1","2","3"},{"4","5","6"}};
             String col[] = {"1","2","3"};
             JTable c = new JTable(data,col); // The simple table
       
             c.setRowSelectionInterval(1,1); // Set initial selection
             c.selectAll(); // Select all
             
             System.out.println(c.getSelectedRowCount());
             System.out.println(c.getRowCount());
             System.out.println(c.getSelectedRowCount()c.getRowCount()); //!!
       
             
             System.exit(0);
          }
       }
       --------------8-<-----------------------------------
       The output is:
       (novo35 60): java JTableBug
       3
       2
       true
       (novo35 61): java -fullversion
       java full version "JDK-1.2beta2-Y"

      ======================================================================

      Attachments

        Activity

          People

            erapinsunw Eric Rapin (Inactive)
            akuzminorcl Alexander Kuzmin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: