Skip to main content

About JFrame

4 replies [Last post]
silspezz
Offline
Joined: 2006-02-15
Points: 0

Any reason why JFrame
- Can not be modal?
- Can not hide or disable both close, minimize and maximize buttons?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
rah003
Offline
Joined: 2004-05-26
Points: 0

> But the reason that I ask it in Swinglabs forum are:
>
Point I was trying to make is that your question is not related to any of the swinglabs subprojects. There is a forum http://forums.java.net/jive/forum.jspa?forumID=74 for asking swing and awt related questions and you are more likely to find answers for your questions there then here.
Jan

rah003
Offline
Joined: 2004-05-26
Points: 0

> Any reason why JFrame
> - Can not be modal?
> - Can not hide or disable both close, minimize and
> maximize buttons?

Any reason why:
- you asked this in Swinglabs forum?
- you can't do a bit of search yourself and read tutorials? (hint: ever heard of undecorated frames/windows)?

silspezz
Offline
Joined: 2006-02-15
Points: 0

Yes, Sir, I use and I know undecoreted frames/windows

But the reason that I ask it in Swinglabs forum are:

1) Now we can have only modal JDialogs but NOT modal JFrames, why that?
I think that having modal JFrame may be very usefull; now, when we have
to use "modality" we have to use JDialogs, I think is too restrective.

2) Why we can not disable maximize OR minimize OR close botton or
(only one) leaving the other enabled in a [b]decorated[/b] JFrame?
Using undecorated frame we lose JFrame caption and all control bottons.
And in context that we need to disable, for example, only the close button?

Excuse me for your time.

osbald
Offline
Joined: 2003-06-13
Points: 0

Probably going to put my foot in it again.. What are you trying to achieve with modal frames? It would be an odd concept. One of the few reasons I can think of for preferring a Frame is that frames will get an entry in the taskbar (Windows). This will also include the native context menus for applications - often including options for multi-monitor support, flashing when the content changes etc..

At the core of things JFrame dosn't support modality so we wouldn't have a peer to work with. Modality is also (often) coupled with parentage - another feature missing from Frame. You might get some mileage from using JInternalFrames insetad, or throwing up GlassPanes over frames you don't to be enabled or doing something unpleasant with the Event Dispatch Thread (have a look at how Dialog works). But I suspect you've actually got some ulterior motives for wanting modal frames.