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.

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

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

Image image = images(index);

please send me the code for implementing in JSP...
thanks in advance
prabhu.


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

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

Image image = images(index);

Hi everyone,

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.