Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make a window look like this in Java?

How do I create a window which looks like this in Java:

frame

I want that window layout, instead of the standard Windows-borders, and I don't know how this is called.

Edit: look and feel doesn't work for me:

not working for me

like image 458
friedkiwi Avatar asked Feb 22 '11 07:02

friedkiwi


People also ask

Which method is used to show the frame window?

Java AWT Programming Project We can implement most of the java swing applications using JFrame. By default, a JFrame can be displayed at the top-left position of a screen. We can display the center position of JFrame using the setLocationRelativeTo() method of Window class.

What is JDialog in java?

The JDialog control represents a top level window with a border and a title used to take some form of input from the user. It inherits the Dialog class. Unlike JFrame, it doesn't have maximize and minimize buttons.

What is a JTextField in java?

JTextField is a lightweight component that allows the editing of a single line of text. For information on and examples of using text fields, see How to Use Text Fields in The Java Tutorial. JTextField is intended to be source-compatible with java.


1 Answers

If you want your Look and Feel to draw the window decoration (that's what the "border" is called), then you need to call JFrame.setDefaultLookAndFeelDecorated(true) before creating your JFrame objects and JDialog.setDefaultLookAndFeelDecorated(true) before creating your JDialog objects.

like image 141
Joachim Sauer Avatar answered Sep 17 '22 22:09

Joachim Sauer