JFrame « Container « Java Swing Q&A





1. How can I check if something leaves the Screen? - JFrame    stackoverflow.com

I have a ball based on a component and I've thought that using the isShowing() method would do the trick but after my ball leaves the container, (Pong game) the isShowing() ...

2. Multiple JFrames in 1 Container    coderanch.com

So, I tried it. import java.awt.*; import javax.swing.*; public class Testing { public Testing() { JFrame window1 = new JFrame("Window 1"); JFrame window2 = new JFrame("Window 2"); Container container = window1.getContentPane(); container.setLayout(new FlowLayout()); JLabel label = new JLabel("Test"); container.add(label); window2.add(label); window1.setSize(200, 100); window1.setVisible(true); window2.setSize(200, 100); window2.setVisible(true); } public static void main(String [] args) { Testing app = new Testing(); } } ...

3. Can JFrame be added to a container?    coderanch.com