pivot-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brendan cheng <ccp...@hotmail.com>
Subject How to dynamically add component to window
Date Sat, 17 Sep 2011 08:57:01 GMT

Hi,
I must say I'm totally new to Pivot.  I'm trying add a box pane to my window's scroll pane
but even the code compiled properly, the box pane just doesn't show up.
Here is the snippet from my main program.
	@Override
    	public void startup(Display display, Map<String, String> properties) throws Exception
{
        String language = properties.get(LANGUAGE_KEY);
        Locale locale = (language == null) ? Locale.getDefault() : new Locale(language);
        Resources resources = new Resources(ClientWindow.class.getName(), locale);


        BXMLSerializer bxmlSerializer = new BXMLSerializer();
        window = (ClientWindow)bxmlSerializer.readObject(getClass().getResource("client_window.bxml"),
            resources);
        ScrollPane rightScrollPane = (ScrollPane) bxmlSerializer.getNamespace().get("rightScrollPane");
        BoxPane commentPane = null;
        try {
			commentPane = (CommentPane)bxmlSerializer.readObject(getClass().getResource("thumbnail/comment_pane.bxml"),
			    resources);
		} catch (IOException e) {
			e.printStackTrace();
		} catch (SerializationException e) {
			e.printStackTrace();
		}
        rightScrollPane.add(commentPane);
        window.open(display);(display);
What do you recommend to do this job in pivot?
Thanks in advance!
Brendan 		 	   		  
Mime
View raw message