特別なハッシュタグを使用してツイートのインターフェイスを作成しようとしています。ツイートにプロフィール写真の画像を追加したいのですが、twitter4j を使用して Twitter プロフィール写真を取得する方法はありますか?
質問する
2360 次
2 に答える
3
次のコードを実行します。
Assume that the Twitter object is mytTwitter
*get the user from the twitter object
User user = mytTwitter.showUser(mytTwitter.getid());
*get the profile image URL
URL url = user.getProfileImageURL();
*create Image icon
ImageIcon img = new ImageIcon(url);
*set the JLabel icon to be the ImageIcon
Jlabel1.setIcon(img);
于 2013-08-05T10:46:49.223 に答える
2
はい、できます。ステータスを取得してから、次のことを行う必要があります。
status.getUser().getProfileImageURL(); //returns a string which is profile image url
詳細な使用方法:
于 2013-08-05T10:42:20.547 に答える