JButton btnOk = new JButton("OK");
here JButton is a class, btnOk is a object of the class JButton.
new is a keyword which allocate memory to btnOk object after taking it from Constructor (JButton()).
here constructor is passing parameter as "OK" which will be displayed on the button.
No comments:
Post a Comment