Top "Jframe" questions

A JFrame is a component and top-level container of the JFC/Swing framework.

How to programmatically close a JFrame

What's the correct way to get a JFrame to close, the same as if the user had hit the X …

java swing jframe
How to set JFrame to appear centered, regardless of monitor resolution?

While working with Java, I find it hard to position my main window in the center of the screen when …

java swing jframe position
How to make a JFrame button open another JFrame class in Netbeans?

I have a JFrame class and it was made in the design section on Netbeans. I am trying to make …

java swing netbeans jframe
How to change JFrame icon

I have a JFrame that displays a Java icon on the title bar (left corner). I want to change that …

java swing jframe icons
Setting background images in JFrame

Are any methods available to set an image as background in a JFrame?

java image swing background jframe
How to place a JButton at a desired location in a JFrame using Java

I want to put a Jbutton on a particular coordinate in a JFrame. I put setBounds for the JPanel (which …

java swing jframe jbutton
JFrame Exit on close Java

I don't get how can I employ this code: frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); to close the program with …

java jframe
Adding image to JFrame

So I am using Eclipse with Windows builder. I was just wondering if there was anyway I can import an …

java image swing background jframe
JFrame background image

I am creating a GUI, albeit a simple one, and I want to have a background image (2048 X 2048) fill up …

java swing background jframe
How to capture a JFrame's close button click event?

I want to call a method confirmExit() when the red close button of the title bar of a JFrame is …

java swing jframe windowlistener