• Post Reply Bookmark Topic Watch Topic
  • New Topic

Adding Images to JLIST  RSS feed

 
david foley
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi i am currently creating a Twitter Application within Java Swing using JSON

i have the JList populating with Home feeds but i also want to get Images displaying next to the Text

currently all i am getting is
http://pbs.twimg.com/profile_images/425056422972248065/tsHhUvEe_normal.png
http://pbs.twimg.com/profile_images/472043355963006976/MjRINlxF_normal.jpeg

So a am able to get the URL Link but getting that to a Image seems to be the problem





 
K. Tsang
Bartender
Posts: 3648
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you are not getting the image when you do?



You may want to consider using the ImageIO#read method.

 
Darryl Burke
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
david foley wrote:So a am able to get the URL Link but getting that to a Image seems to be the problem


I would expect that to throw a MalformedURLException.
 
david foley
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Darryl Burke wrote:
david foley wrote:So a am able to get the URL Link but getting that to a Image seems to be the problem


I would expect that to throw a MalformedURLException.



I am getting



But Get No Error when i have it this way
 
K. Tsang
Bartender
Posts: 3648
16
Firefox Browser Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to get only one URL each time.

Looking at your for loop, you seem to be missing the index

Or you may just want to use the for-each loop.

Edit: how come you for loop is
int x=0; arrayImage.size()<x; x++

rather than
int x=0; x<arrayImage.size(); x++
 
david foley
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
K. Tsang wrote:You need to get only one URL each time.

Looking at your for loop, you seem to be missing the index

Or you may just want to use the for-each loop.

Edit: how come you for loop is
int x=0; arrayImage.size()<x; x++

rather than
int x=0; x<arrayImage.size(); x++


Typo..

I change it to For Each



Getting No Errors but not able to see Icons.. might just leave it off
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!