pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Garimella Srinivas <garimella_srini...@yahoo.co.in>
Subject Re: MDI Application regarding
Date Sat, 28 Nov 2009 08:00:46 GMT
I have got the code in java now and working. Sending the same for use by others .

public class Windows implements Application { 
    private Window window = null; 
    private Frame frame = null; 
    private Toolkit kit = Toolkit.getDefaultToolkit(); 
    private    Dimension dim = kit.getScreenSize(); 
    private Display display = null; 
    private PushButton pb; 
    private BoxPane bp; 
    private PushButton pb2;     
     
        @Override 
        public void startup(final Display display, Map<String, String> properties) throws
Exception { 
            this.display = display; 
            int x = 0; 
            int y = 0; 
           for (int i = 0; i < 5; i++) { 
           final Frame frame = new Frame(); 
           frame.setTitle("Frame " + (i + 1)); 
                frame.setLocation(x, y); 
                x += 20; 
                y +=20; 
                bp = new BoxPane(); 
                bp.setPreferredHeight(200); 
                bp.setPreferredWidth(250); 
                pb = new PushButton(); 
                pb2 = new PushButton(); 
                pb2.setButtonData("Open Dialog 2"); 
                pb.setButtonData("OPEN DIALOG"); 
                pb.getButtonPressListeners().add(new ButtonPressListener() { 
 
                    @Override 
                    public void buttonPressed(Button arg0) { 
                        // TODO Auto-generated method stub 
                        MyDialog md = new MyDialog(); 
                        md.setPreferredHeight(300); 
                        md.setPreferredWidth(500); 
                        md.open(frame,null); 
                        } 
                     
                }); 
                pb2.getButtonPressListeners().add(new ButtonPressListener() { 
 
                    @Override 
                    public void buttonPressed(Button arg0) { 
                        // TODO Auto-generated method stub 
                        MyDialog2 md2 = new MyDialog2(); 
                        md2.setPreferredHeight(300); 
                        md2.setPreferredWidth(500); 
                        md2.open(frame,null); 
                        } 
                     
                }); 
 
                bp.add(pb); 
                bp.add(pb2); 
                 
                ApplicationContext.DisplayHost displayHost = display.getDisplayHost(); 
                displayHost.setPreferredSize(dim); 
                java.awt.Frame awtHostFrame = (java.awt.Frame)displayHost.getParent(); 
                awtHostFrame.pack(); 
                frame.setContent(bp); 
                frame.open(display); 
            } 
        } 
      
        @Override 
        public boolean shutdown(boolean optional) { 
            for (int i = display.getLength() - 1; i >= 0; i--) { 
                Window window = (Window)display.get(i); 
                window.close(); 
            } 
            return false; 
        } 
      
        @Override 
        public void suspend() { 
        } 
      
        @Override 
        public void resume() { 
        } 
     /* 
        public static void main(String[] args) { 
            DesktopApplicationContext.main(Windows.class, args); 
        } 
}

 Thanks
Garimella Srinivas




________________________________
From: Greg Brown <gkbrown@mac.com>
To: pivot-user@incubator.apache.org
Sent: Fri, November 27, 2009 10:47:34 PM
Subject: Re: MDI Application regarding


The WTKX primer is pretty short. Once you read through it, you should be able to very quickly
grasp what the corresponding Java code would look like. Of course, if you have any questions,
please feel free to post them here.

Greg


On Nov 27, 2009, at 4:10 AM, Garimella Srinivas wrote:

Yes I was referring tohttp://svn.apache.org/repos/asf/incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/windows/.
I requested for a Java version so as to understand the implentation immediately.
>
>G Srinivas
>
>
>
>
>
________________________________
From: Todd Volkert <tvolkert@gmail.com>
>To: pivot-user@incubator.apache.org
>Sent: Thu, November 26, 2009 8:41:19 PM
>Subject: Re: MDI Application regarding
>
>Hi Garimella,
>
>Do you have a link to the example in question so we can make sure we're all talking about
the same example?  I'm guessing you're talking abouthttp://svn.apache.org/repos/asf/incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/windows/,
but I'm not positive.
>
>Thanks,
>-T
>
>
>On Thu, Nov 26, 2009 at 10:04 AM, Garimella Srinivas <garimella_srinivas@yahoo.co.in>
wrote:
>
>
>>
>>The given example is a wtkx version. I meants a Java only version of the above example.

>>
>>Garimella Srinivas
>>
>>
>>
>>
>>
________________________________
From: Greg Brown <gkbrown@mac.com>
>>To: pivot-user@incubator.apache.org
>>Sent: Thu, November 26, 2009 6:33:48 PM
>>Subject: Re: MDI Application regarding
>>
>>
>>
>>Hi Garimella,
>>
>>
>>I am not 100% sure what you are asking, but it sounds like you are assuming that the
Windows tutorial is specific to the Windows operating system. The term "window" in this case
actually refers to the Pivot Window class, not Microsoft Windows. That example will actually
run on all supported Pivot platforms (i.e. any OS with Java 6 or greater).
>>
>>
>>Please let us know if you have any additional questions.
>>
>>Greg
>>
>>
>>On Nov 26, 2009, at 6:47 AM, Garimella Srinivas wrote:
>>
>>Hi,
>>>Seen the example provided in the windows tutorial for building multi document
interfaces. Is there a Java only version for the same.  If so please give pointer.
>>>
>>>Thanks
>>>Garimella Srinivas
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>
>
>



      
Mime
View raw message