Kishan Bheemajiyani
Kishan Bheemajiyani

Reputation: 3439

How to Disable root Frame when Another is Open in Swing java

I have one JFrame and in that I have 10 JLabel which will open new JFrame. that JFrame is Same that will open in 10 label but how to Disable that root JFrame when the Another JFrame is open and Enable that Root JFrame when that new frame is Closed? Can I have your Suggestion please.

Upvotes: 0

Views: 624

Answers (1)

camickr
camickr

Reputation: 324108

Don't use multiple JFrames. An application should only have a single JFrame.

For secondary windows you should use a modal JDialog. A modal JDialog will not allow you to click on the parent JFrema until the dialog is closed.

Upvotes: 5

Related Questions