views:

16

answers:

1

Is it possible to code as if you are coding for any web application [ use html, jsp, css, spring etc ], but on execution it should not require any container or any server. It should run as if we are running a swing application.

Somebody told me that Adobe Flex is just what i am asking for. Is it so?

+1  A: 

You are looking for Adobe AIR. It lets you define the user interface using a markup language called MXML and compiles it in to a desktop application that is platform independent. Though AIR uses the Flex framework, it has additional classes that allows you to interact with the desktop environment (file handling, window management etc).

AIR is platform independent - you can run an AIR application on any platform that has AIR environment installed in it (just like you need to install java to run a java app).

Here is a sample AIR code.

<?xml version="1.0" encoding="utf-8"?>
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml"
    title="App Title" width="400" height="200" 
    creationComplete="someFunction()">
    <mx:TextInput id="ti"/>
    <mx:Button id="btn" label="Click Me!" click="onClick();"/>
    <mx:Script>
        <![CDATA[
            private function someFunction():void
            {
                ti.text = "Application created!";
                //do initialization stuff here
            }
            private function onClick():void
            {
                ti.text = "You clicked me!"
            }
        ]]>
    </mx:Script>
</mx:WindowedApplication>
Amarghosh
i will try this, thanks :) +1
Rakesh Juyal