不管在写什么程序的时候,好的注释是非常重要,代码不只是给自己看的,对于某些公司事务调整,对于后期的维护都非常重要。对于自己写的代码,
如果自己长期不碰,对于核心的业务逻辑,也会遗忘,所以一定要写注释,对自己负责,也是对公司,对代码负责.选简单列举java注释
JTable为列
<p><p> 一个段落
<code>JTableHeader</code> 类表示
<a href></a>超链接
<pre><pre>独立代码段落
<strong><strong>强调
{@link JTableHeader}链接类
@see #Method 查看方法
/**
* The <code>JTable</code> is used to display and edit regular two-dimensional tables
* of cells.
* See <a href="http://java.sun.com/docs/books/tutorial/uiswing/components/table.html">How to Use Tables</a>
* in <em>The Java Tutorial</em>
* for task-oriented documentation and examples of using <code>JTable</code>.
*
* <p>
* The <code>JTable</code> has many
* facilities that make it possible to customize its rendering and editing
* but provides defaults for these features so that simple tables can be
* set up easily. For example, to set up a table with 10 rows and 10
* columns of numbers:
* <p>
* <pre>
* TableModel dataModel = new AbstractTableModel() {
* public int getColumnCount() { return 10; }
* public int getRowCount() { return 10;}
* public Object getValueAt(int row, int col) { return new Integer(row*col); }
* };
* JTable table = new JTable(dataModel);
* JScrollPane scrollpane = new JScrollPane(table);
* </pre>
* <p>
* Note that if you wish to use a <code>JTable</code> in a standalone
* view (outside of a <code>JScrollPane</code>) and want the header
* displayed, you can get it using {@link #getTableHeader} and
* display it separately.
* <p>
* When designing applications that use the <code>JTable</code> it is worth paying
* close attention to the data structures that will represent the table's data.
* The <code>DefaultTableModel</code> is a model implementation that
* uses a <code>Vector</code> of <code>Vector</code>s of <code>Object</code>s to
* store the cell values. As well as copying the data from an
* application into the <code>DefaultTableModel</code>,
* it is also possible to wrap the data in the methods of the
* <code>TableModel</code> interface so that the data can be passed to the
* <code>JTable</code> directly, as in the example above. This often results
* in more efficient applications because the model is free to choose the
* internal representation that best suits the data.
* A good rule of thumb for deciding whether to use the <code>AbstractTableModel</code>
* or the <code>DefaultTableModel</code> is to use the <code>AbstractTableModel</code>
* as the base class for creating subclasses and the <code>DefaultTableModel</code>
* when subclassing is not required.
* <p>
* The "TableExample" directory in the demo area of the source distribution
* gives a number of complete examples of <code>JTable</code> usage,
* covering how the <code>JTable</code> can be used to provide an
* editable view of data taken from a database and how to modify
* the columns in the display to use specialized renderers and editors.
* <p>
* The <code>JTable</code> uses integers exclusively to refer to both the rows and the columns
* of the model that it displays. The <code>JTable</code> simply takes a tabular range of cells
* and uses <code>getValueAt(int, int)</code> to retrieve the
* values from the model during painting.
* <p>
* By default, columns may be rearranged in the <code>JTable</code> so that the
* view's columns appear in a different order to the columns in the model.
* This does not affect the implementation of the model at all: when the
* columns are reordered, the <code>JTable</code> maintains the new order of the columns
* internally and converts its column indices before querying the model.
* <p>
* So, when writing a <code>TableModel</code>, it is not necessary to listen for column
* reordering events as the model will be queried in its own coordinate
* system regardless of what is happening in the view.
* In the examples area there is a demonstration of a sorting algorithm making
* use of exactly this technique to interpose yet another coordinate system
* where the order of the rows is changed, rather than the order of the columns.
* <p>
* As for all <code>JComponent</code> classes, you can use
* {@link InputMap} and {@link ActionMap} to associate an
* {@link Action} object with a {@link KeyStroke} and execute the
* action under specified conditions.
* <p>
* For the keyboard keys used by this component in the standard Look and
* Feel (L&F) renditions, see the
* <a href="doc-files/Key-Index.html#JTable"><code>JTable</code> key assignments</a>.
* <p>
* <strong>Warning:</strong>
* Serialized objects of this class will not be compatible with
* future Swing releases. The current serialization support is
* appropriate for short term storage or RMI between applications running
* the same version of Swing. As of 1.4, support for long term storage
* of all JavaBeans<sup><font size="-2">TM</font></sup>
* has been added to the <code>java.beans</code> package.
* Please see {@link java.beans.XMLEncoder}.
*
*
* @beaninfo
* attribute: isContainer false
* description: A component which displays data in a two dimensional grid.
*
* @version 1.210 05/06/04
* @author Philip Milne
分享到:
相关推荐
将开发中常用的Java知识,通过代码和注释来讲解。
java中链表的创建 使用 实例 。初学者用于理解链表的使用。带有60%带有注释。 java链表 链表的讲解 java源代码加注释
java经典基础编程题(包含代码,详细的注释以及思路的讲解),且每个例子都在MyEclipse上运行通过,且编码规范,有助于大家解读代码,注释中包含一些java的基础思想以及技巧的讲解,非常有助于java初学者上手,对...
jdk注释讲解
java 入门视频, 主要讲解 注释 变量 运算符
我们都阅读过 JDK API,但是庞大的API文档是怎么生成的?有谁知道 如何能保持代码的修改与代码文档的同步?这就是 javadoc 的存在目的。 这个文档将详细讲解 代码注释 怎么成为代码说明文档。
详细的描述了java编写俄罗斯方块的过程,思路清晰,方向明确,简单易懂
该博客搭配资源 https://blog.csdn.net/weixin_45478419/article/details/129126918 自学多线程时,为了更好理解多线程的实现方式,各个方法,从而编写的。
对HashMap 源码逐行进行注释,带你深入理解HashMap原理,使面试不在困难,
java命名规范以及注释规范.doc word格式 19页 讲解详细有丰富的例子
get set方法生成注释和字段注释.zip,包括GetterSetterUtil.java、GetterSetterUtil.class、get set方法生成注释和字段注释.docx详细讲解如果用快捷方式生成set、get注释
java输入输出的深入讲解,javase中io流是一个比较难但是很重要得学习部分。这个文档很值得学习。
用代码实例和注释向你讲述什么是多态,实例更容易理解
//冒泡 Bubble bubble=new Bubble(); bubble.sort(arr); print(arr);//打印结果 //选择 Select select=new Select(); select.sort(arr); print(arr);//打印结果 //插入 ...//打印结果
完整注释JAVA基本连连看框架,同时与https://blog.csdn.net/qq_37457202/article/details/80659017#t12博客讲解一致,当然有什么不理解的也欢迎在博客上留言,博客后期将会继续更新
7 1.2.2 编写第1个Java程序 8 1.2.3 classpath属性的作用 9 1.3 本章要点 10 1.4 习题 10 第2章 简单的Java程序 11 视频讲解:20分钟 2.1 一个简单的Java范例 11 2.2 Java程序的注释 13 JAVA JAVA开发 J2SE JAVA基础...
JAVA项目坦克大战代码内涵详细解释,本代码是根据马士兵老师的课程编写的,个人加了很多详细的注解。懒得看视频的同学可以下载瞧瞧~~
安卓初学到精通 Demo加注释 以及讲解实例 外加 80个安卓实用例子
javaDVD管理器,包含注释,所以功能完全。
名校老师讲解的Java预热班课程 上课老师讲解代码+Java课件+课本代码++API) 是一个比较全面的入门级资源 是自学,入门的好材料,代码编译通过,附有大部分的注释有利于大家学习