Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

error message

 
Thomas Whalen
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is the error message I got when running my java program that uses a nested while(){} loop:
Warning: Cannot allocate colormap entry for default background.

here is my code: I really have NO clue what I am doing wrong :/
 
Jason Menard
Sheriff
Posts: 6450
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One thing I notice is that you are checking for the value of Strings using "==" instead of equals() or equalsIgnoreCase().
You might want to change the appropriate conditionals to something like the following:
if("yes".equals(run))
while("yes".equals(run))
while("yes".equals(flag))
HTH
 
William Barnes
Ranch Hand
Posts: 986
Eclipse IDE Firefox Browser Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure.
But don't you want to use ".equals()" instead of "=="?
 
Thomas Whalen
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
At the time I didn't know that I wanted to use ".equals("foo")", but now I do It's been a while since I played with this language.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic