could any one suggest me the way to show multiple image Using Jlist for example i would like to show thumbnail view of image in a jtabbedpane and on selecting two image they both should open in a other jtabbedoane
We have a forum dedicated for Swing questions. I will move this topic over there for you.
You can use a custom renderer for your JList which could be a JPanel instance and then add the image(s) to the panel.
JLabel with an icon would be the easiest way to go.
I do not understand the relation between the JList and JTabbedPane. Could you please rephrase what you are trying to do here?
We have a forum dedicated for Swing questions. I will move this topic over there for you.
You can use a custom renderer for your JList which could be a JPanel instance and then add the image(s) to the panel.
JLabel with an icon would be the easiest way to go.
I do not understand the relation between the JList and JTabbedPane. Could you please rephrase what you are trying to do here?
i simply need to show multiple images (like thumbnail view of windows) in java and want some event to occur on selecting the image....
Yes. Maneesh provided a link to a tutorial. So instead of reading it, you asked for code instead. How do I know you didn't read it? Because the tutorial includes code which provides examples which would be helpful to you.
Since you're new to Java, you should know that the Oracle tutorials (like the one Maneesh linked to) are the best way to learn about particular topics in Java. So if you want to learn about JList, read the JList tutorial. Download the example code and run it, and then fiddle around with the code. Change it to do something a little different, and then change it to do something a lot different. That's the way to learn Java.
ashish donvir
Greenhorn
Joined: Mar 01, 2012
Posts: 25
posted
0
Michael Dunn wrote:if you expect this
"...would you please come with some code and show me..."
then this
"well as i am new to java development"
will never change.
Here is my code what i tried. as you can see i had drawn the images in tab name set image. so instead of drawing i actually need to load all images and then allow user to select the image and it should open in other name compare image. suggest me what change i should do in my code to fulfill my requirements? how to generate thumbnail view and allow user to select image
You could use a JList as suggest before and use your own list cell renderer for your images. Your renderer could look like this, assuming that your values are ImageIcons.