I have two forms. First one is to decide button numbers by using jslider. Second form is to display jbuttons according to jslider value. When i click jbutton2, the second form shows and display buttons. It is working perfectly. However, I want to create jbutton without clicking jbutton2 in the first form.
Instead, when I change jslider, it should create buttons on the second form at the run time and once i change jslider it should create that amount of button again on the second form and refresh the second form buttons number according to jslider value.
I have tried revalidate();, repaint(); but they do not work, they dont refresh the second form.
So, How can I refresh second form when the jslider ,that is on the first form, changes ?
I have two forms. First one is to decide button numbers by using jslider.
Share
Actually you should provide a piece of code so we can understand it better.
But generally i think i could understand what you mean (if i’m not wrong).
Basically you need the layout manager on the second form.
here is a code sample, i hope it can generally answer your need.
Code for the first form
Code for the second form
Hope this can help you out.