PDA

View Full Version : Java? ?


frederickan moose
10-12-2007, 02:41 PM
I want to convert a picked number (created pick function return a # between the 1st and 2nd parameter), and make it say its between 0 and 26 then add 0x60, therefore making it a character value of a-z, correct?
this is the code,
char ch = pick(0,26) + 0x60;
String c = "" + ch;
setBackground(Color.BLACK);
g.setColor(new Color(20, 230, 30));
g.setFont(new Font("Times New Roman", Font.BOLD,50));
g.drawString(c,300, 250);

But its an error saying the + in the char assignment between pick and 0x60 saying possible loss of precision .. req'd: char found: int...

how can i get this to work?