Creating a Borderless Window - Java Swing

Java examples for Swing:JFrame

Description

Creating a Borderless Window

Demo Code

import java.awt.BorderLayout;

import javax.swing.JLabel;
import javax.swing.JWindow;

public class Main {
  public void m() throws Exception {
    JWindow window = new JWindow();

    // Add component to the window
    window.getContentPane().add(new JLabel(), BorderLayout.CENTER);

    // Set initial size
    window.setSize(300, 300);//from  w ww.  j av  a 2s.  c  om

    // Show the window
    window.setVisible(true);
  }
}

Related Tutorials