About 15,800,000 results
Open links in new tab
  1. Java JFrame - GeeksforGeeks

    May 5, 2025 · setLocationRelativeTo(Component c) Positions the JFrame relative to the specified component. If null, it centers the frame on the screeen.

  2. swing - Java - adding components to JFrame - Stack Overflow

    Apr 10, 2012 · The JFrame class is slightly incompatible with Frame. Like all other JFC/Swing top-level containers, a JFrame contains a JRootPane as its only child. The content pane provided …

  3. JFrame basic tutorial and examples - CodeJava.net

    Jul 6, 2019 · We can use the method add (Component) to add a component to the frame’s content pane. For example, adding a text field: with BorderLayout: add (textFieldUserName, …

  4. How to Make Frames (Main Windows) - Florida State University

    Two common techniques are used to provide the components for a frame's content pane: Create a container such as a JPanel, a JScrollPane, or a JTabbedPane, add components to it, then …

  5. How to Make Frames (Main Windows) (The Java™ Tutorials - Oracle

    JFrame frame = new JFrame("A window"); //Set the frame icon to an image loaded from a file. frame.setIconImage(new ImageIcon(imgURL).getImage()); As the preceding code snippet …

  6. Creating Frames using Swings in Java - GeeksforGeeks

    Feb 17, 2022 · Java swing components are lightweight, platform-independent, provide powerful components like tables, scroll panels, buttons, lists, color chooser, etc. In this article, we'll see …

  7. JFrame (Java Platform SE 8 ) - Oracle

    For example, you can add a child component to a frame as follows: frame.add(child); And the child will be added to the contentPane. The content pane will always be non-null. Attempting to …

  8. java - How to position components in a JFrame? - Stack Overflow

    Dec 5, 2017 · To create the expected layout, you might have to define Layouts on subcomponents of your frame. 1) Provide ASCII art or a simple drawing of the intended layout …

  9. Java Swing | Internal Frame with examples - GeeksforGeeks

    Apr 14, 2021 · JInternalFrame is a container that provides many features of a frame which includes displaying title, opening, closing, resizing, support for menu bar, etc. Commonly used …

  10. java - How to add multiple components to a JFrame ... - Stack Overflow

    JFrame frame; frame.setLayout(new FlowLayout()); Now, if you add more than one box, it will show up on the frame. The other option is to do what you said you tried.