Have borders on a JWindow/JFrame : Window « Swing JFC « Java






Have borders on a JWindow/JFrame

 

import java.awt.FlowLayout;

import javax.swing.JButton;
import javax.swing.JPanel;
import javax.swing.JWindow;

public class Main{
  public static void main(String s[]) {
    JWindow win = new JWindow();

    JPanel pan = new JPanel();
    win.add(pan, "Center");

    pan.setLayout(new FlowLayout());
    pan.add(new JButton("Hello"));

    win.setSize(200, 200);
    win.setVisible(true);
  }
}

   
  








Related examples in the same category

1.Get Window from a component