JSlider problem

hello, i am going to use JSlider to zoom my graphic polygon.

However when I fire the Slider,the graph move on the screen liking animation. That is not my expection. I guees I used repaint() to cause it, but if I remove repaint(), slider will not function at all.how can I drawing it?

thanks

[309 byte] By [ardmorea] at [2007-11-27 10:07:30]
# 1

You've got questions in the Java Programming forum, the Java 2D forum, the New to Java Forum and finally the Swing forum.

Quit cross posting and multiposting the question all over the place. Nobody can follow you question on this one topic because advice is all over the place.

Keep the questions in one place and start replying to each posting as you make the posting if you want help in the future.

I know I've certainly lost track of what the heck you are doing since you aren't posting code incorporating all the suggestions you've received.

If you really want help the post your SSCCE.

camickra at 2007-7-13 0:43:48 > top of Java-index,Desktop,Core GUI APIs...
# 2
Thanks for your reminding. My codes is too long and it includes GUI , 2D and Swing. It seems to be invoking each forum, so I just select a forum randomly.
ardmorea at 2007-7-13 0:43:48 > top of Java-index,Desktop,Core GUI APIs...
# 3
And my code will parse a file(I/O), so it makes me hard to SSCCE since this forum doen't provide attachment function.
ardmorea at 2007-7-13 0:43:48 > top of Java-index,Desktop,Core GUI APIs...
# 4

You create something that demonstrates your problem. It doesn't have to be exactly what your real application is doing. If your problem is understanding how a JSlider works then maybe you create a simple demo that changes the size of a JPanel as the slider is moved. Once you understand the basic concept you apply what you learned to the real problem.

Thats why creating a SSCCE helps you in problem solving. If forces you to simplify the whole process.

And yes you can do file I/O in a simple SSCCE if you think its really really necessary. For example:

String file = "line1\nline2\nline3".

StringReader reader = new StringReader( file );

You just created a file with 3 lines of text. Now you can use the reader like any other text file.

camickra at 2007-7-13 0:43:48 > top of Java-index,Desktop,Core GUI APIs...