Closed. This question is off-topic。它当前不接受答案。
                            
                        
                    
                
                            
                                
                
                        
                            
                        
                    
                        
                            想改善这个问题吗? Update the question,所以它是on-topic,用于堆栈溢出。
                        
                        6年前关闭。
                                                                                            
                
        
我正在尝试创建带有特殊标签的推文界面,并且我想在推文中添加个人资料照片图片,有没有办法使用twitter4j获取Twitter个人资料照片?

最佳答案

通过以下代码。

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);

关于java - 获取Twitter个人资料照片,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/18056063/

10-10 16:16