Shelef
Shelef

Reputation: 3827

Can I make a JFrame look like JWindow?

Can I remove the border and the minimize and close buttons from a JFrame? I can't use a JWindow because it can't handle keyListener as I understood. (At least not easily). How can I do that?

Upvotes: 2

Views: 1389

Answers (2)

mKorbel
mKorbel

Reputation: 109815

Can I remove the border and the minimize and close buttons from a JFrame?

I can't use a JWindow because it can't handle keyListener as I understood. (At least not easily).

  • JFrame, JDialog or JWindow doesn't react to KeyListener, JComponent must be FocusOwner or implemented setFocusable for KeyListener

  • don't to use KeyListener, use KeyBindings instead

I can't use a JWindow because it can't handle keyListener as I understood.

  • shot to the dark,

  • JTextComponents aren't editable (really don't know reason) in JWindow without visible JFrame as parent

Upvotes: 7

dm76
dm76

Reputation: 4240

Not sure what you're really trying to achieve here... but would setUndecorated(true) do it for you?

Upvotes: 1

Related Questions