ifyou dontmind
ifyou dontmind

Reputation: 1

Make a borderless JFrame

Any parameter to set A JFrame's border/frame thickness or existence and still keep the title bar intact? I want an almost borderless frame with a thin blue line like this one and not like the default border.

If JFrame isn't the way to go, what is a good way to achieve that? (preferably that is compatible with WindowBuilder but that's probably asking for too much).

A search barely yields any mention and related questions on SOF don't seem to have answers so I thought I'd try to get a good answer once and for all.

Upvotes: 0

Views: 2770

Answers (2)

ifyou dontmind
ifyou dontmind

Reputation: 1

I ended up switching to NetBeans and learning some Photoshop basics which you'll need thanks to a comment by @MadProgrammer

writing your own look and feel delegate

and ended up exactly with what you mentioned @theProgrammer101

You can make a JButton, and when it is clicked, call System.exit(0) , which will terminate the program

You can create a similar button for minimize action as well as your own drop down menus that are totally custom made and you won't need to rely on the default JFrmae window in case that bothers you too (I found it horrid).

check out this link for a good NetBeans tutorial with an nice example of writing your own look and feel delegate and this link for a great tutorial on getting started with Photoshop which is critical to GUI creation.

Thought i'd round up some of my research for anyone else who's just getting into GUI's.

Upvotes: 0

MadProgrammer
MadProgrammer

Reputation: 347234

JFrame#setUndecorated

Disables or enables decorations for this frame.

This method can only be called while the frame is not displayable. To make this frame decorated, it must be opaque and have the default shape, otherwise the IllegalComponentStateException will be thrown. Refer to Window.setShape(java.awt.Shape), Window.setOpacity(float) and Window.setBackground(java.awt.Color) for details

Please, consult the available documentation

Please note, you will become responsible for providing the title bar yourself, should you want it

A search barely yields any mention and related questions on SOF don't seem to have answers

Google provides a number of promising hits

Upvotes: 1

Related Questions