Java Doc for SimpleTableModel.java in  » IDE-Netbeans » vmd.analyzer » org » netbeans » microedition » lcdui » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Netbeans » vmd.analyzer » org.netbeans.microedition.lcdui 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.netbeans.microedition.lcdui.SimpleTableModel

SimpleTableModel
public class SimpleTableModel implements TableModel(Code)
Simple implementation of TableModel. This model can hold a matrix of String values. A matrix means all rows have to have the same number of columns and rows cannot be null.
author:
   breh



Constructor Summary
public  SimpleTableModel(String[][] values, String[] columnNames)
     Creates a model with given values and column names.
Parameters:
  values - values to be used in this table model.
public  SimpleTableModel(int rows, int cols)
     Creates a model with given number of rows and columns.
Parameters:
  rows - number of rows to be used in the model.
public  SimpleTableModel()
     Creates a new empty table model.

Method Summary
public synchronized  voidaddTableModelListener(TableModelListener listener)
     Adds a TableModelListener to this instance of the model.
public  voidfireTableModelChanged()
     Fires an event that the values in the table has been changed and the table should be repainted.
public  intgetColumnCount()
     Gets number of columns of the supplied values matrix.
public  StringgetColumnName(int column)
    
public  intgetRowCount()
     Gets number of rows of the supplied values matrix.
public  ObjectgetValue(int col, int row)
     Gets the value of a table cell at a specified location.
public  String[][]getValues()
    
public  booleanisUsingHeaders()
     Decides wheter this table is using headers (column names).
public synchronized  voidremoveTableModelListener(TableModelListener listener)
     Removes a TableModelListener from this instance of the model.
public  voidsetColumnNames(String[] columnNames)
     Sets the column names for this model.
public  voidsetValue(int col, int row, String value)
     Sets the value to the defined row and column of the model.
public  voidsetValues(String[][] values)
     Sets the values of the model.


Constructor Detail
SimpleTableModel
public SimpleTableModel(String[][] values, String[] columnNames) throws IllegalArgumentException(Code)
Creates a model with given values and column names.
Parameters:
  values - values to be used in this table model. Please note, the values cannot be nulland have to be a valid matrix.
Parameters:
  columnNames - column names to be used. Can be null if the column names are not goingto be used (see @isUsingHeaders method).
throws:
  java.lang.IllegalArgumentException - If the values parameter is null, or if it is not a valid rectangular matrix.



SimpleTableModel
public SimpleTableModel(int rows, int cols) throws IllegalArgumentException(Code)
Creates a model with given number of rows and columns.
Parameters:
  rows - number of rows to be used in the model. Cannot be negative.
Parameters:
  cols - number of columns to be used in the model. Cannot be negative.
throws:
  java.lang.IllegalArgumentException - if the cols or rows argument are lower than zero



SimpleTableModel
public SimpleTableModel()(Code)
Creates a new empty table model.




Method Detail
addTableModelListener
public synchronized void addTableModelListener(TableModelListener listener)(Code)
Adds a TableModelListener to this instance of the model.
Parameters:
  listener - listener to be addded



fireTableModelChanged
public void fireTableModelChanged()(Code)
Fires an event that the values in the table has been changed and the table should be repainted. This method is intended to be used by the user, since the model cannot track changes of values in the supplied arrays.



getColumnCount
public int getColumnCount()(Code)
Gets number of columns of the supplied values matrix. values matrix column count



getColumnName
public String getColumnName(int column)(Code)
Gets the column name for the specified index
Parameters:
  column - column index column name



getRowCount
public int getRowCount()(Code)
Gets number of rows of the supplied values matrix. values matrix row count



getValue
public Object getValue(int col, int row)(Code)
Gets the value of a table cell at a specified location. Always returns String. value for the given cell coordinates. May return null if there is no value.
Parameters:
  col - col index of the value
Parameters:
  row - row index of the value



getValues
public String[][] getValues()(Code)
Gets values of the model values matrix



isUsingHeaders
public boolean isUsingHeaders()(Code)
Decides wheter this table is using headers (column names). This simple model simply checks whether the supplied column names are null and in such a case this method returns true. true if the column names are being supplied and should be visualized, false otherwise



removeTableModelListener
public synchronized void removeTableModelListener(TableModelListener listener)(Code)
Removes a TableModelListener from this instance of the model.
Parameters:
  listener - listener to be removed



setColumnNames
public void setColumnNames(String[] columnNames)(Code)
Sets the column names for this model. The array of names should have the same length as the column count.
Parameters:
  columnNames - array of names. May be null if the column headers should not be visualized



setValue
public void setValue(int col, int row, String value) throws IllegalArgumentException(Code)
Sets the value to the defined row and column of the model.

Please note, this method does not call fireTableModelChanged method automatically, so you have to call it manually if you would like to redraw the table. This is designed in this way, because of the performance reasons - you might want to update several values at a time and repaint the table at the end of the update.
throws:
  java.lang.IllegalArgumentException - if the values are not defined, or the specifed row or column is larger than the size of the values.




setValues
public void setValues(String[][] values) throws IllegalArgumentException(Code)
Sets the values of the model. Values of this model have to be a rectangular matrix - this means all rows have to have the same number of columns and rows canot be null.

Please note, this class is holding just reference to the passed values array, so any change you do to the model via setValue method is actually made in the array.
Parameters:
  values - values to be used in this table model. Please note, the values cannot be nulland have to be a valid matrix.
throws:
  java.lang.IllegalArgumentException - If the values parameter is null, or if it is not a valid rectangular matrix.




Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.