This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund 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
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Reply 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
Bartender

Joined: Aug 22, 2010
Posts: 2331
    
    2

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 !
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: How to make Modality backword compatible?
 
Similar Threads
java.lang.UnsupportedClassVersionError
Is any version of jBOSS-5 compatible with jdk1.5
A strange compile error with Maven2
Java upgrade path
SCJP1.4