Jframe

F

Francois Lionet

Hello,

In my application, I open a JFrame, and I need this frame to be
caption-less. Can someone tell me how to get rid of the title bar and the
border?

Thank you!
Francois
 
A

Andrew Thompson

In my application, I open a JFrame, and I need this frame to be
caption-less. Can someone tell me how to get rid of the title bar and the
border?

<sscce>
import javax.swing.*;

class UndecoratedFrame {

public static void main(String[] args) {
JFrame f = new JFrame();
f.setUndecorated(true);
f.getContentPane().add(
new JLabel("How do you close me?"));
f.pack();
f.setLocationRelativeTo(null);
f.setVisible(true);
}
}
</sscce>

Andrew T.
 
M

Mark Space

Francois said:
Hello,

In my application, I open a JFrame, and I need this frame to be
caption-less. Can someone tell me how to get rid of the title bar and the
border?

Thank you!
Francois

Why not just use JWindow?
 
A

Andrew Thompson

Francois Lionet wrote: ... ...
Why not just use JWindow?

Excellent question.

(..but please trim replies of sigs., and other
unnecessary text)

Andrew T.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,540
Members
45,025
Latest member
KetoRushACVFitness

Latest Threads

Top