简体   繁体   中英

How can we make a movable sentence?

例如,我想在我的主框架中使用一个类似于“系统”的句子,它可以从框架的左侧移动到框架的右侧或向上移动到向下。我该怎么做?

I think you are trying to implement a sliding text. You may use the Timer class to set your label's(or whatever the component is) position. Every time the Timer ticks, you may increment the position or decrement it, the rest is up to your choice.

And I also must say, that you should be more clear when asking questions.

I guess you are looking for a mqrquee component in Swing. Here is a simple3 example of how to rite one in swing.

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