DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/)
-   Java (http://www.daniweb.com/forums/forum9.html)
-   -   Change Image based on user Input (http://www.daniweb.com/forums/thread52841.html)

kssprabhu Aug 19th, 2006 4:09 pm
Change Image based on user Input
 
Dear friends.
Please give me the logic or code to display image based on number(in database) entered in the text box by the user.
thanks in advance
prabhu.

Phaelax Aug 20th, 2006 4:31 pm
Re: Change Image based on user Input
 
JTextField imageField = new JTextField(4);
Image[] images = new Image[42]; //array of images

int index = Integer.parseInt(imageField.getText());

Image image = images(index);

kssprabhu Aug 20th, 2006 5:07 pm
Re: Change Image based on user Input
 
please send me the code for implementing in JSP...
thanks in advance
prabhu.



Quote:

Originally Posted by Phaelax
JTextField imageField = new JTextField(4);
Image[] images = new Image[42]; //array of images

int index = Integer.parseInt(imageField.getText());

Image image = images(index);


freesoft_2000 Aug 20th, 2006 5:39 pm
Re: Change Image based on user Input
 
Hi everyone,

Quote:

Originally Posted by kssprabhu
please send me the code for implementing in JSP.



I don't mean to be bad, but the solution phaelax gave you can be implemented in most languages. His alogarithm is simple to use.

You can read up on arrays and this will most probably give you an idea of what he is doing but i doubt anyone will plonk down the answers for you

Richard west


All times are GMT -4. The time now is 9:33 am.

Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC