Hi, is this advisable? I was trying to create multiple windows with JFrame with only one instance of the Container class. I do it like this...
JFrame window1 = new JFrame("Window 1");
JFrame window2 = new JFrame("Window 2");
Container container = window1.getContentPane();
container.setLayout(new FlowLayout());
window1.setSize(200, 100);
window1.setVisible(true);
window2.setSize(200, 100);
window2.setVisible(200, 100);
I've tried this and it worked. I didn't paste the whole code because I'm typing on my mac and surfing the internet through PC. I'd just like to ask if it's ok to do this practice? Or is ther something I should avoid in doing this? Thanks!