Hello Winarto
Originally Posted by Winarto
I don't understand what is the different of static void, protected, or void in method.
A
static modifier means that this field or method is the only one that will ever be created. That means that you do not have to create it because it already exists. A static member can be used anywhere in your program, by referring to it's class name. For example:
int test = Integer.parseInt("10");
The word
void means "an empty space". So that means that a void method returns nothing.
Originally Posted by Winarto
why can we use this 'setDefaultCloseOperation' this time,without create an object first.
You are extending your class, C, from JFrame. That means that C inherits all the inheritable members of the JFrame class and now you can call then as if you created them. A class defines how an instance of it should behave. So technically, "this" is an instance of C. Try this in your constructor before initComponents():
this.setTitle("I'm an instance of C.");
I hope this helped.