AliasesDropDown(IApplication app) { super(); _myApp = app; final AliasesDropDownModel model = new AliasesDropDownModel(app, this); setModel(model); // Under JDK1.4 the first item in a JComboBox // is no longer automatically selected. if (getModel().getSize() > 0) { setSelectedIndex(0); } // Under JDK1.4 an empty JComboBox has an almost zero width. else { final Dimension dm = getPreferredSize(); dm.width = 100; setPreferredSize(dm); } addActionListener(this); setMaximumSize(getPreferredSize()); app.getDataCache().addAliasesListener(new MyAliasesListener(model, this)); this.setName(this.getClass().getCanonicalName()); }
AliasesDropDown(IApplication app) { super(); _myApp = app; final AliasesDropDownModel model = new AliasesDropDownModel(app, this); setModel(model); // Under JDK1.4 the first item in a JComboBox // is no longer automatically selected. if (getModel().getSize() > 0) { setSelectedIndex(0); } // Under JDK1.4 an empty JComboBox has an almost zero width. else { final Dimension dm = getPreferredSize(); dm.width = 100; setPreferredSize(dm); } addActionListener(this); setMaximumSize(getPreferredSize()); app.getDataCache().addAliasesListener(new MyAliasesListener(model, this)); this.setName(this.getClass().getCanonicalName()); }