Вопрос

I was wondering how would you go about creating dynamically lets say a bunch of JSliders at runtime and adding listeners to each one of those sliders? I've tried doing this by creating an array of JSliders like the bit of code shown below, but not sure how to go about creating listeners for each one of those sliders built during runtime. Also obviously the below code won't compile correctly this is just the snippit of the important part of description of what I created:

private JSlider slider[] = new JSlider[100];

for(int i=1; i<=numinputed; i++)
{
    slider[i] = new JSlider();
}       

Since I haven't seen any answers to this questions on google felt like asking here on stackoverflow. This is just for learning purposes and hope someone can point me into the right direction thanks :)

Нет правильного решения

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top