I am building a Swing desktop application with similar functionality for Twitter. I have a feed page that displays tweets.
I have tweets in JPanel and you want to dynamically display new ones by adding new tweets at the top of JPanel and moving older ones. I tried to do this using MigLayout, using jpanel.add(tweet, "cell 0 0, wrap"), however this did not work as intended, and in order to display it with the layout I wanted, I had to call jpanel.revalidate().
This is not ideal, as many tweets may appear every second, and redrawing the panel can be quite slow. In any case, can I add new “tweets” to the top of the panel without redrawing?
source
share