简体   繁体   中英

How to scroll from left right to left on a JLabel

I have a JLabel on which I added an RSS Feed. But how can I slide the text from right to left, because the feed is too long and I want to read the whole feed.

final JLabel news = new JLabel("Loading";
news.setText(readRSSFeed("http://yourfeed.com");

Thank you in advance!

Somewhere you should be adding your label to a container like this add(news) . So if you replace it with add(new JScrollPane(news)) it will show scrolls if text overflow to visible area.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM