swing - Java Initialization Block -
Can someone help me understand the following construction? I am having trouble understanding that it is an early or an unknown class. I am not familiar with this syntax. JTable jt = New JTable (Data, Field) ** {Public Table Cell Renderer getCellRenderer (int row, EIT column) {// TODO automatically generated method stub return renderer; }}; **
This creates an anonymous internal square that extends to JTable, and Overrides GetCellRenderer method
Long explanation:
You are creating a class that explicitly enhances JTable without the name, instead of using the standard class declaration:
Expanded JTable JTable {}> Public Category Extended Visibility of this class is limited to that class, within which it has been defined and done immediately. To override a method (getCellRenderer ()) of a particular class (jettbol), when it is quite useful for you, like the code you need, for some purposes it is limited to the current category reference.
This approach has some advantages and some limitations are also to take a look at this for deep discussion.
Comments
Post a Comment