I have created a for loop that detects the amount of devices connected to the computer. This then creates 2 JFrames, so every devices has it's own window. I now want to add data to those windows, so I created a while loop inside the for loop. But this stops the for loop from completing, meaning that only one JFrame shows data, and the second JFrame is not visible. If I remove the while loop from the for loop then 2 windows appear, but only one window is showing data, and the other window is blank. So the question is how do I get multiple while loops running to show data on multiple JFrames, based on a for loop.
for(int i = 0; i < controllers.length; i++) {
if(controllers[i].getType() == Controller.Type.STICK) {
window = new JFrameWindow();
while(true)
{