MultiplePageDialog pack()

This is the forum for JIDE Common Layer which is open sourced at https://github.com/jidesoft/jide-oss. Please note, JIDE technical support doesn't monitor this forum as often as other forums. Please consider subscribe for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

Moderator: JIDE Support

Forum rules
Community driven forum for open source JIDE Common Layer. JIDE technical support doesn't monitor this forum as often as other forums. If you only use JIDE Common Layer, please consider subscribing for technical support for JIDE Common Layer so that you can use customer only forum to get a timely response.

MultiplePageDialog pack()

Postby jtheuer » Fri Apr 11, 2008 2:35 am

Hi, I created a MPD. But its initial size is very small. Furthermore, the buttons stick at the bottom-right border, I expected a cleaner look when I read the pdf tutorial. Did I do something wrong?

Code: Select all
Copyright 2007 52North Initiative for Geospatial Open Source Software GmbH

   
package de.jtheuer.diki.gui;
import java.awt.Component;

/**
 * @author Jan Torben Heuer <jan.heuer@uni-muenster.de>
 *
 * Configuration window for diki
 */
public class ConfigurationWindow extends MultiplePageDialog implements DikiStrings {
   /* automatically generated Logger */@SuppressWarnings("unused")
   private static final Logger LOGGER = Logger.getLogger(ConfigurationWindow.class.getName());
   private Properties properties;
   private final Component rootFrame;
   
   /**
    *
    */
   public ConfigurationWindow(Frame owner, Properties properties) {
      super(owner,Messages.getString("ConfigurationWindow.1"),true,ICON_STYLE); //$NON-NLS-1$
      rootFrame = owner;
      this.properties = properties;
      
      setTitle(Messages.getString("ConfigurationWindow.1"));
      setPageList(getPages());
      pack();
      setVisible(true);
   }
   
   private PageList getPages() {
      PageList pages = new PageList();
      pages.addElement( new AbstractDialogPage("general",ResourcesContainer.CONFIGURE.getAsIcon(32)) {
         /** The general dialog */
         private static final long serialVersionUID = 0L;

         @Override
         public void lazyInitialize() {
            add(new JTextField());
         }
            
      });
      
      pages.addElement( new AbstractDialogPage("moduels",ResourcesContainer.MODULES.getAsIcon(32)) {
         /** The modules dialog */
         private static final long serialVersionUID = 0L;

         @Override
         public void lazyInitialize() {
            add(new JTextField());
         }
            
      });

      pages.addElement( new AbstractDialogPage("Themes",ResourcesContainer.MODULES.getAsIcon(32)) {
         /** The modules dialog */
         private static final long serialVersionUID = 0L;

         @Override
         public void lazyInitialize() {
            JComboBox combobox = new JComboBox(UIController.getAvailableLnFs());
            combobox.addItemListener(UIController.getListener(combobox,rootFrame,this));
            add(combobox);
         }
            
      });
   
      return pages;
   }

}


Image

Jan
jtheuer
 
Posts: 9
Joined: Wed Apr 02, 2008 3:13 am

Postby JIDE Support » Fri Apr 11, 2008 6:54 am

All our dialog pages are lazily loaded. You don't want to load them when the dialog is created as it could take a long time to create all the pages in the MPD. So the way you pack() in the constructor will stop this lazy loading from working. The correct way is to do it outside. Just take a look at our demo and try to use the same pattern as we are using in the demo.

Thanks,
JIDE Software Technical Support Team
JIDE Support
Site Admin
 
Posts: 37219
Joined: Sun Sep 14, 2003 10:49 am


Return to JIDE Common Layer Open Source Project Discussion (Community Driven)

Who is online

Users browsing this forum: No registered users and 78 guests