Categories

JAVA DATEBASE
Technology Network Community
Oracle Database
Fusion Middleware
Development Tools
Java
Desktop
Server & Storage Systems
Enterprise Management
Berkeley DB Family
Cloud Computing
Big Data
Business Intelligence
Architecture
Migration and Modernization
E-Business Suite
Siebel
PeopleSoft Enterprise
JD Edwards World
Industries
JD Edwards EnterpriseOne
User Productivity Kit Pro (UPK) and Tutor
Governance, Risk & Compliance (GRC)
Master Data Management (MDM)
Oracle CRM On Demand
On Demand: SaaS and Managed Applications
AutoVue Enterprise Visualization
Primavera
ATG
Agile PLM
Endeca Experience Management
Fusion Applications
Archived Forums

 



Tags

New To Java


Problem with JTable and changeSelection method


Hi!  I can't get the changeSelection (int row, int col, boolean, boolean) to work. Actually, nothing happens when I call it. When i print the row and col count it clearly says, row = 100 and col = 1. Anybody know why changeSelection() doesnt work?  try {                  JTable table = new JTable( model );                         model.setRowCount(0);                       Vector data = new Vector();         String aLine;                filename = listener.getFilename();         if (filename == null)         throw new IOException("No filename");            else { 	LogFile f = FileManager.getInstance().openReadonly(filename);             for (int i =0 ; i <20 ; i++){                  int myseqno = 0;             String xmpInfo = null;                              f.positionAt(foundAtSeqno -10);                      myseqno = f.read(b);             while (XMP.getBodyLen(b) == 0) {                 xmpInfo = "(extHdr) ";                 myseqno = f.read(b);             }                      Vector row = new Vector();             String s = new String(b, XMP.getBodyOffset(b), XMP.getBodyLen(b));             Object g = new StringCellValue(s, fakeObject);                      row.addElement(g);               model.insertRow(i ,row);             model.fireTableDataChanged();                      foundAtSeqno++; //            System.out.println("Rowcount" + table.getRowCount()); //            System.out.println("Colcount" + table.getColumnCount());       }      System.out.println("Rowcount" + table.getRowCount());                          table.changeSelection(10, 0, false, false); 

try to do this: model.fireTableDataChanged();  after table.changeSelection(10, 0, false, false);   did you see the documentation : http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/JTable.html#changeSelection(int,%20int,%20boolean,%20boolean)   ?

No, still, nothing happens...


Related Links

Static Methods
please help me
Log4j problem
please help - problem with maskformatter
Something wrong with this method :S
JTable questions
Cant import a timer help pls
Restrict how many checkboxes can be selected
How to delete a jdk1.6.0_01 folder on linux desktop?
co-ordinate problem
Errors in Map class
Java classes
Convert byte to String
Timer inside cycles
constructors and a call
Create Jars and programs for windows environments