This site requires JavaScript, please enable it in your browser!
Greenfoot back
SAMAD101
SAMAD101 wrote ...

2015/3/2

when it compiling it say cannot find symbol

SAMAD101 SAMAD101

2015/3/2

#
textboxB.setText(Cipher.convertString(textboxA.getText(), codeKey)); please help!!
danpost danpost

2015/3/2

#
It obviously has no idea what you mean by 'textboxB' or 'textboxA' (or 'convertString' or 'codeKey'). Maybe you should show the code of the 'Cipher' class as well as the code of the class that the line you gave is in.
SAMAD101 SAMAD101

2015/3/2

#
import greenfoot.*; /** * a world to demonstrate Ceasar Ciphering */ public class CipherWorld extends World { private Textbox textboxA, textboxB; // the text boxes private int codeKey; // the cipher key /** prepares world */ public CipherWorld() { super(380, 500, 1); addObject(textboxA = new Textbox(), getWidth()/2, 40); addObject(textboxB = new Textbox(), getWidth()/2, 80); } /** processes keyboard input and maintains string values of textboxes */ public void act() { String key = Greenfoot.getKey(); if (key != null) { if ("space".equals(key)) key = " "; if ("backspace".equals(key) && textboxA.getText().length() > 0) { String text = textboxA.getText(); text = text.substring(0, text.length()-1); textboxA.setText(text); } if ("escape".equals(key)) textboxA.setText(""); if ("up".equals(key)) codeKey = (codeKey+1)%26; if ("down".equals(key)) codeKey = (codeKey+25)%26; if (key.length() == 1) textboxA.setText(textboxA.getText()+key); }
SAMAD101 SAMAD101

2015/3/2

#
can you tell me where i have gone wrong
danpost danpost

2015/3/2

#
SAMAD101 wrote...
can you tell me where i have gone wrong
No -- as you only gave a condensed version of the error message you received. (for one thing)
You need to login to post a reply.