get a handle on interfaces
Every poster here has added to foothold on understanding what is going on. I chose applet to gain java's networking utility and make the table run-time dynamic, the types in the table should be fixed at design time - which is where I am at - but the number of rows is likely to vary in use, possibly in dramatic fashion. I thought that an applet would provide a great toolkit for both authentication and display, avoiding hardcoding of a forest of forms.
For example, being able to re-order by column header would be challenging to do in hardcode using forms. A handy local-scope class for that would simplifiy greatly. serant most closely grasps my original need, simple grasp of how calling new right before curly braces circumvent writing dedicated class. I guess what TableModel tm = new TableModel(){....} does is bring libs to bear power on the application of that class to the design without .... ( ? without what ... )
It appears here I could write some class, defining an interface, then do myUtilityClass mc = new myUtilityClass() { .... } which would bring several tools I have not thought of yet to the design. What my original post was intended to grasp how to use TableModel correctly as previous efforts did not go to effective control of Table display. ( Actually, that was to be a List at that time, viewed in list sorted by Code:
public boolean equals(Object obj) // Indicates whether some other object is "equal to" this Comparator.
{
Customer c = (Customer) obj;//
if(this.getKey() > c.getKey()) return false;
if(this.getKey() < c.getKey())return false;
if(this.getKey() == c.getKey())return true;
}
which was, eventually, to drive Code:
// By default, a list allows more than one item to be selected
// Also, the selected items need not be contiguous.
JList northList = new JList(searchTerms);
JList southList = new JList(searchFields);
JList eastList = new JList(triggerWords);
JList westList = new JList(stopWords );
Right at the moment, I am doing a start from scratch(0) and sought to grasp how to use TableModel correctly.
Thus, ftr's Quote:
just that the definition of what a Baz object is follows immediately.
which tells me that the semi-colon is replaced by curly braces leaves me stuck trying to dis-entangle the syntactic sugar. How can we define a class, then use that class as we drop in to the curly braces unless we wrote that class aforehand? I think I'm missing something here. I also think it is deep in compiler science and exposes a handy optimization that will fail if I do not grasp how TableModel gets a handle on the table it is supposed to model.
I could, easily with the code skills I have attained, define the class right there - and do it with no name - using the work comfortably in the activation record. Easily. What I think I need to understand in depth is: Quote:
Its just syntactic sugar. To have good form, the anonymous class should not be more than a half dozen lines, if its longer than that, name it.
much like the current implementation of invokeLater() .... in fact those curly-braces and semi-colon mashed together like scripting moves the mouse when there is no cat around drives me nuts as I do not undersand where control is going.
I can grasp that it is making the repainting idempotent, that's obvious for me. It's the compiler science of what is going on that I am uncertian about. I can test this in a JFrame or JPanel, adding it to an applet later. The application must be resistant to some other stability issues, that is where the power of applet can add security due to it's authentication built-in's. All I need to do here is grasp how to load the Table and display it ... along with reloads and so on consequent to ActionEvent's that are fired.
Probably, rephrase original post title to "What is an interface?" and attack as though some Master's cs student has gone glass-eyed on data structures and needs to think about something else for awhile, showing an undergrad how to use an interface.