0

I'm new to java, actually i want to display friend list with their images in swing app. which component should i use?

Thanks

onlycode
  • 13
  • 4

3 Answers3

1

You could use a JList

ListList

or JTable to achieve this.

Table

Take a look How to Use Lists and How to Use Tables for more details

MadProgrammer
  • 343,457
  • 22
  • 230
  • 366
  • As outlined in [How to Use Lists](http://docs.oracle.com/javase/tutorial/uiswing/components/list.html), [Writing a Custom Cell Renderer](http://docs.oracle.com/javase/tutorial/uiswing/components/list.html#renderer) – MadProgrammer Aug 19 '14 at 08:16
0

Try JLabel.

Image image = GenerateImage.toImage(true); //this generates an image file
JLabel thumb = new JLabel();
thumb.setIcon(image)

See this page for more guidance: Java: how to add image to Jlabel?

Community
  • 1
  • 1
Rishi Raj
  • 3
  • 3
0

You can either use a JList or a JTable.

Dan D.
  • 32,246
  • 5
  • 63
  • 79