permaculture playing cards*
The moose likes Swing / AWT / SWT and the fly likes Brush function doesnt appear Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Brush function doesnt appear" Watch "Brush function doesnt appear" New topic
Author

Brush function doesnt appear

Miko Jing
Greenhorn

Joined: Dec 11, 2013
Posts: 5
in my paint program have brush function. It seem doesnt appear anything when select the brush function.

Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36453
    
  15
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.
Sam Gooding
Ranch Hand

Joined: Dec 06, 2013
Posts: 35
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 agree. Here's the link: http://aspose.com/file-tools
 
subject: Brush function doesnt appear
 
Similar Threads
Drawing with mouse
How to plot a graph in Java ?
Program Anomaly
How to save configuration for my application??
How to group these JLabels?