Jesper de Jong wrote:I see a bug in your code:
This should have been:
You don't want to compare whatever e.getSource() returns to the string "jbtOk", you want to check if it is the object that the variable jbtOk refers to.
Jesper de Jong wrote:This should have been:
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Jesper de Jong wrote:@Winston You could argue that in this case you would want to check that the event came from the actual JButton object that you've created and that's used in the GUI, so reference equality is what you'd want to use...
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Vlad Adrian wrote:trying to make as loosely coupled as I can
Stephan van Hulst wrote:
Junilu Lacar wrote:See the Law of Demeter...
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Junilu Lacar wrote:Note that calling a non-final method from a constructor can lead to unpleasant surprises in subclasses. In this case, the method called from the constructor is private so I don't think there will be a problem. See articles about calling non-final methods from constructors in Java if you want to know more.