File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT and the fly likes almost done 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 "almost done" Watch "almost done" New topic
Author

almost done

Victoria Preston
Ranch Hand

Joined: Feb 03, 2006
Posts: 106
I'm trying to get this gui to work, but my listeners are not working. My program is just crashing. Can someone look at it and tell me where I am going wrong.Here are my listeners
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
you should post the error messages, but this part is wrong
if(value.equals(null))

as 'value' is the return from getText(), it could be empty, not null
if(value.equals(""))

if checking for null, it would be
if(value == null)
Victoria Preston
Ranch Hand

Joined: Feb 03, 2006
Posts: 106
I found that error you saw just a minute ago. But it still doesn't work and here are the error messages
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

firstly, "almost done" is not a useful topic at all. You should browse the pointers on asking questions on the Ranch as it will help you get answers.

You should print the value of "sc" each time before using it. I am not sure you re getting the behaviour you expect.
Victoria Preston
Ranch Hand

Joined: Feb 03, 2006
Posts: 106
what do you mean I should print it out
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459



If it prints out "sc is null" you have found your problem.
Victoria Preston
Ranch Hand

Joined: Feb 03, 2006
Posts: 106
I found my problem thank you
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: almost done
 
Similar Threads
listeners
I useDelimiter \t(ab) with my Scanner, but it splits around spaces
Onchange JCombobox
Prompting the user whether to close the JFrame
Scanner is skipping