0

When making a GUI, does it matter whether you use 'content' or 'this'?

For Example:

content.add(b1);

OR

this.add(b1);
2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by progr
1

Yes.
'this' refers to the current object - whatever that object is. It could be anything.
'content' refers to whatever you defined it as. Most likely it's a Container ref obtained from getContentPane() somewhere in your program.

0

Yes.
'this' refers to the current object - whatever that object is. It could be anything.
'content' refers to whatever you defined it as. Most likely it's a Container ref obtained from getContentPane() somewhere in your program.

Thanks a lot, that has cleared things up

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.