Ask Your Question
0

Is there an alternative method to displaying or hiding my JFrame game without using setVisible() to true and false?

asked 2023-05-01 10:46:54 +0000

devzero gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-05-01 11:09:02 +0000

pufferfish gravatar image

Yes, you can use the following methods:

1) setEnabled(boolean enabled) method can be used to enable or disable the JFrame.

2) setOpacity(float opacity) method can be used to set the opacity of the JFrame.

3) setDefaultCloseOperation(int operation) method can be used to set the default close operation of the JFrame.

4) setExtendedState(int state) method can be used to set the extended state of the JFrame, such as maximized or minimized.

You can use a combination of these methods to achieve the desired behavior of displaying or hiding the JFrame, without using setVisible() method.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-05-01 10:46:54 +0000

Seen: 9 times

Last updated: May 01 '23