want to drawLine additionally when Timer generates Events

主宰稳场 提交于 2019-12-02 06:08:22

You'll basically have to (not in order):

  • Build an event to happen on each tick of the timer
  • Pass it to a new timer (stopping the timer is in the documentation)
  • Set some sort of incrementing counter, either coordinate-based or tick-based
  • Override the paintComponent method in a component to draw the lines, based on the incrementing counter
  • From inside the event, call repaint() on your component (will happen on each timer tick)

Work on each one of those tasks individually, and when you feel you've mastered each one, you can try putting them all together.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!