I am trying to create a program that launches any number of sub windows. How can I make it that each subsequent window opened is opened shifted to the bottom right so all the windows can be seen at the same time?
I have been able to make this offset with a static variable but windows will eventually be put off screen. How can I prevent that?
To fully understand my question try launching multiple calculator windows and watch the behavior. Is there a way to emulate that in Java?
Here's what I'm doing currently
private static int locationOfset = 0;
public ATMWindow(ATM atm) {
...
setBounds(500 + (50 * locationOfset), 300 + (50 * locationOfset), 450, 300);
locationOfset++;
...
}
Before you suggest CardLayout or something similar, I truly do want multiple JFrames if you can believe it.