Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Brush function doesnt appear

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in my paint program have brush function. It seem doesnt appear anything when select the brush function.

 
Marshal
Posts: 69895
278
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I never like listeners which test for their origin. Of course using the == operator on Strings is very likely to fail. Otherwise, don't know. I htink that is too much code to read.
 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because startPoint and endPoint are defined locally to the loop which you leave when you go on to process the "brush" part of paintComponent. They both therefore become null , and you only process your brush logic if they AREN'T null (which they are , because they're out of scope) .
 
I guess everyone has an angle. Fine, what do you want? Just know that you cannot have this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic