8 JFrame Examples You Should Know - Swing
JFrame is a top-level container which is nothing more than a window with a title bar and an optional menu bar.
- Creating a JFrame in Swing Example - A Kickstart
This example introduces the most common methods of JFrame class.
- Set background color in JFrame
You cannot set the background for a JFrame just by using the
setBackground()method. This example contains the single thing you need to set the background.
- Set background image in JFrame
This example shows you how to set a background image in JFrame in three ways.
- 3 Ways to Set Icon image for JFrame
An icon image is the one that appears in the top-left corner of a title bar. The example will teach you three simple ways to set icon.
- How to create a transparent JFrame in Swing
Opaque frames are boring. Aren't they? This example shows how to create semi-transparent JFrame easily using a simple method.
- Create shaped transparent JFrame in Swing
You can also set custom shape to a JFrame but it should be undecorated. This example contains JFrames of different shapes.
- Using setDefaultLookAndFeelDecorated() in JFrame
This example contains how to set the default look and feel decorated so that the titlebar's appearance changes.
- Double titlebar for JFrame in Swing
Creating a double titlebar is weird but can be done in a single line!