This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes How to make Modality backword compatible? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How to make Modality backword compatible?" Watch "How to make Modality backword compatible?" New topic
Author

How to make Modality backword compatible?

Ashwini Suneeth
Greenhorn

Joined: Dec 16, 2010
Posts: 3
Hi,
Our project uses both 1.5 and 1.6. 1.6 has this modality types like Dialog.ModalityType.DOCUMENT_MODAL which can be passed in as a argument in the Constructor specific to 1.6.
So , previous 1.5 constructor was just JDialog(Frame owner, String title, boolean modal) .
How can I make modality compatible with 1.5 ?
Martin Vajsar
Sheriff

Joined: Aug 22, 2010
Posts: 3718
    
  61

Use only the methods available in 1.5.

The modality extension is specific to Java 1.6, it is not available in earlier releases. Not only the methods are missing in the API, the other needed library code is simply not there. If your application needs these new modes, it cannot be run on 1.5.

Maybe your application might test the JRE version and use the 1.6 features only when available, disallowing or limiting functions that cannot be fully implemented in 1.5; however, I've no idea how - or whether at all - is this doable.
Ashwini Suneeth
Greenhorn

Joined: Dec 16, 2010
Posts: 3
Thanks a lot Martin !
 
Have you checked out Aspose?
 
subject: How to make Modality backword compatible?
 
It's not a secret anymore!