Hmm, I guess I'm just confused as to why you wouldn't make it like this:
class MyClass{
JButton but;
...
MyClass(){
but = new JButton("Test");
...
Type: Posts; User: bbr201
Hmm, I guess I'm just confused as to why you wouldn't make it like this:
class MyClass{
JButton but;
...
MyClass(){
but = new JButton("Test");
...
I guess another way of thinking about the same question is: what happens when you add the button to the content pane? Is another reference to the JButton object created somewhere?
hi all,
i am looking at some very simple beginner swing applications and i have a quick question. in the examples given, certain components are created within the constructor of the class:
...