JFormDesigner 5.0.4 Runtime API

com.jformdesigner.runtime
Class FormCreator

java.lang.Object
  extended by com.jformdesigner.runtime.FormCreator
All Implemented Interfaces:
com.jformdesigner.runtime.BeanProvider, com.jformdesigner.runtime.ComponentProvider

public class FormCreator
extends java.lang.Object
implements com.jformdesigner.runtime.ComponentProvider, com.jformdesigner.runtime.BeanProvider

Creates instances of Swing components from a form model and provides methods to access components. Use FormLoader to load a form model from a JFormDesigner .jfd file into memory.

First invoke one of the create methods. Then you can use the getter methods to access the created Swing components. Use the standard Swing methods to add listeners, set values or get values.

Example:

 // load the .jfd file into memory
 FormModel formModel = FormLoader.load( "com/jformdesigner/examples/LoaderExample.jfd" );

 // create a dialog
 FormCreator formCreator = new FormCreator( formModel );
 JDialog dialog = formCreator.createDialog( null );

 // get references to components
 JTextField nameField = formCreator.getTextField( "nameField" );
 JCheckBox checkBox = formCreator.getCheckBox( "checkBox" );
 JButton okButton = formCreator.getButton( "okButton" );

 // set values and add listeners
 nameField.setText( "enter name here" );
 okButton.addActionListener( new ActionListener() {
        public void actionPerformed( ActionEvent e ) {
                // add your code...
        }
 } );

 // show dialog
 dialog.setModal( true );
 dialog.pack();
 dialog.show();

 System.out.println( nameField.getText() );
 System.out.println( checkBox.isSelected() );
 

If you've assigned event handlers in the form, use setTarget(Object) to set a target for the events.


Constructor Summary
FormCreator(FormModel model)
          Creates a new FormCreator for the specified form model.
FormCreator(FormModel model, java.lang.ClassLoader classLoader)
          Creates a new FormCreator for the specified form model using the specified class loader.
FormCreator(FormModel model, java.util.Locale locale, java.lang.ClassLoader classLoader)
          Creates a new FormCreator for the specified form model using the specified locale and class loader.
 
Method Summary
 java.awt.Component create()
          Creates the component hierarchy for the first top level form component.
 java.awt.Component create(java.lang.String name)
          Creates the component hierarchy for the specified name.
 java.awt.Component create(java.lang.String name, java.awt.Window owner)
          Creates the component hierarchy for the specified name and passes the specified owner window to the constructor, if the component is an instance of java.awt.Window.
 void createAll()
          Creates all components.
 java.lang.Object[] createBindings()
          Creates the bindings.
 javax.swing.JDialog createDialog(java.awt.Window owner)
          Creates the component hierarchy for the first top level form component, which must be an instance of javax.swing.JDialog.
 javax.swing.JPanel createPanel()
          Creates the component hierarchy for the first top level form component, which must be an instance of javax.swing.JPanel.
 java.awt.Window createWindow(java.awt.Window owner)
          Creates the component hierarchy for the first top level form component, which must be an instance of java.awt.Window.
 java.lang.Object getBean(java.lang.String name)
          Returns the bean for the specified name.
 java.lang.Object getBean(java.lang.String name, boolean create)
          Returns the bean for the specified name.
 javax.swing.JButton getButton(java.lang.String name)
          Returns the component for the specified name.
 javax.swing.JCheckBox getCheckBox(java.lang.String name)
          Returns the component for the specified name.
 javax.swing.JCheckBoxMenuItem getCheckBoxMenuItem(java.lang.String name)
          Returns the component for the specified name.
 javax.swing.JComboBox getComboBox(java.lang.String name)
          Returns the component for the specified name.
 java.awt.Component getComponent(java.lang.String name)
          Returns the component for the specified name.
 javax.swing.JDialog getDialog(java.lang.String name)
          Returns the component for the specified name.
 javax.swing.JEditorPane getEditorPane(java.lang.String name)
          Returns the component for the specified name.
 javax.swing.JFormattedTextField getFormattedTextField(java.lang.String name)
          Returns the component for the specified name.
 javax.swing.JFrame getFrame(java.lang.String name)
          Returns the component for the specified name.
protected  java.util.ResourceBundle getI18nBundle(java.lang.String baseName, java.util.Locale locale, java.lang.ClassLoader loader)
          Gets the resource bundle for the given base name.
protected  java.lang.String getI18nString(java.util.ResourceBundle bundle, java.lang.String baseName, java.lang.String key)
          Gets a string for the given key from the given resource bundle or one of its parents.
 javax.swing.JLabel getLabel(java.lang.String name)
          Returns the component for the specified name.
 javax.swing.JList getList(java.lang.String name)
          Returns the component for the specified name.
 java.lang.ClassLoader getLoader()
          Returns the class loader used to load components.
 java.util.Locale getLocale()
          Returns the locale used to load resource bundles.
 javax.swing.JMenu getMenu(java.lang.String name)
          Returns the component for the specified name.
 javax.swing.JMenuBar getMenuBar(java.lang.String name)
          Returns the component for the specified name.
 javax.swing.JMenuItem getMenuItem(java.lang.String name)
          Returns the component for the specified name.
 FormModel getModel()
          Returns the form model.
 javax.swing.JPanel getPanel(java.lang.String name)
          Returns the component for the specified name.
 javax.swing.JPasswordField getPasswordField(java.lang.String name)
          Returns the component for the specified name.
 javax.swing.JPopupMenu getPopupMenu(java.lang.String name)
          Returns the component for the specified name.
 javax.swing.JProgressBar getProgressBar(java.lang.String name)
          Returns the component for the specified name.
 javax.swing.JRadioButton getRadioButton(java.lang.String name)
          Returns the component for the specified name.
 javax.swing.JRadioButtonMenuItem getRadioButtonMenuItem(java.lang.String name)
          Returns the component for the specified name.
 javax.swing.JScrollBar getScrollBar(java.lang.String name)
          Returns the component for the specified name.
 javax.swing.JScrollPane getScrollPane(java.lang.String name)
          Returns the component for the specified name.
 javax.swing.JSeparator getSeparator(java.lang.String name)
          Returns the component for the specified name.
 javax.swing.JSlider getSlider(java.lang.String name)
          Returns the component for the specified name.
 javax.swing.JSpinner getSpinner(java.lang.String name)
          Returns the component for the specified name.
 javax.swing.JSplitPane getSplitPane(java.lang.String name)
          Returns the component for the specified name.
 javax.swing.JTabbedPane getTabbedPane(java.lang.String name)
          Returns the component for the specified name.
 javax.swing.JTable getTable(java.lang.String name)
          Returns the component for the specified name.
 java.lang.Object getTarget()
          Returns the object that handles events.
 javax.swing.JTextArea getTextArea(java.lang.String name)
          Returns the component for the specified name.
 javax.swing.JTextField getTextField(java.lang.String name)
          Returns the component for the specified name.
 javax.swing.JTextPane getTextPane(java.lang.String name)
          Returns the component for the specified name.
 javax.swing.JToggleButton getToggleButton(java.lang.String name)
          Returns the component for the specified name.
 javax.swing.JToolBar getToolBar(java.lang.String name)
          Returns the component for the specified name.
 javax.swing.JTree getTree(java.lang.String name)
          Returns the component for the specified name.
 javax.swing.JWindow getWindow(java.lang.String name)
          Returns the component for the specified name.
 boolean isSetComponentNames()
          Returns whether java.awt.Component.setName() will be invoked on all components of the form.
protected  java.lang.Object newComponentInstance(java.lang.Class<?> beanClass, java.lang.String compName)
          Creates a new instance of the given bean class.
 void setSetComponentNames(boolean setComponentNames)
          Sets whether java.awt.Component.setName() will be invoked on all components of the form.
 void setTarget(java.lang.Object target)
          Set the object that will handle events.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormCreator

public FormCreator(FormModel model)
Creates a new FormCreator for the specified form model.

Parameters:
model - The form model, from which the components should be created.

FormCreator

public FormCreator(FormModel model,
                   java.lang.ClassLoader classLoader)
Creates a new FormCreator for the specified form model using the specified class loader.

Parameters:
model - The form model, from which the components should be created.
classLoader - The class loader used to load components.

FormCreator

public FormCreator(FormModel model,
                   java.util.Locale locale,
                   java.lang.ClassLoader classLoader)
Creates a new FormCreator for the specified form model using the specified locale and class loader.

Parameters:
model - The form model, from which the components should be created.
locale - The locale used to load resource bundles.
classLoader - The class loader used to load components.
Since:
2.0
Method Detail

getModel

public FormModel getModel()
Returns the form model.

Since:
3.0

getLocale

public java.util.Locale getLocale()
Returns the locale used to load resource bundles.

Since:
3.0

getLoader

public java.lang.ClassLoader getLoader()
Returns the class loader used to load components.

Since:
3.0

getTarget

public java.lang.Object getTarget()
Returns the object that handles events.

Since:
2.0

setTarget

public void setTarget(java.lang.Object target)
Set the object that will handle events.

This object must have handler methods as specified in the form. E.g. if you've specified an actionPerformed() event for a JButton and set the handler method to "myButtonPressed", the target object must implement following method:

 private void myButtonPressed() {
     // handler code
 }
 
If you've set the "Pass parameters" flag to true for the event, you can get the listener parameters:
 private void myButtonPressed(ActionEvent e) {
     // handler code
 }
 

Since:
2.0

isSetComponentNames

public boolean isSetComponentNames()
Returns whether java.awt.Component.setName() will be invoked on all components of the form. Default is false.

Since:
2.0.1

setSetComponentNames

public void setSetComponentNames(boolean setComponentNames)
Sets whether java.awt.Component.setName() will be invoked on all components of the form.

Since:
2.0.1

createAll

public void createAll()
               throws java.lang.Exception
Creates all components. Use one of the getter methods to access beans.

Throws:
java.lang.Exception
Since:
2.0

create

public java.awt.Component create()
                          throws java.lang.Exception
Creates the component hierarchy for the first top level form component.

Returns:
The created component hierarchy.
Throws:
java.lang.Exception

createPanel

public javax.swing.JPanel createPanel()
                               throws java.lang.Exception
Creates the component hierarchy for the first top level form component, which must be an instance of javax.swing.JPanel. Convenience method that invokes create() and casts the result to JPanel.

Returns:
The created panel.
Throws:
java.lang.Exception

createDialog

public javax.swing.JDialog createDialog(java.awt.Window owner)
                                 throws java.lang.Exception
Creates the component hierarchy for the first top level form component, which must be an instance of javax.swing.JDialog. Convenience method that invokes createWindow(Window) and casts the result to JDialog.

Parameters:
owner - The window to act as owner; or null.
Returns:
The created dialog.
Throws:
java.lang.Exception

createWindow

public java.awt.Window createWindow(java.awt.Window owner)
                             throws java.lang.Exception
Creates the component hierarchy for the first top level form component, which must be an instance of java.awt.Window.

Parameters:
owner - The window to act as owner; or null.
Returns:
The created window.
Throws:
java.lang.Exception

create

public java.awt.Component create(java.lang.String name)
                          throws java.lang.Exception
Creates the component hierarchy for the specified name.

Parameters:
name - The name of the form component.
Returns:
The created component hierarchy.
Throws:
java.lang.Exception

create

public java.awt.Component create(java.lang.String name,
                                 java.awt.Window owner)
                          throws java.lang.Exception
Creates the component hierarchy for the specified name and passes the specified owner window to the constructor, if the component is an instance of java.awt.Window.

Parameters:
name - The name of the form component.
owner - The window to act as owner; or null.
Returns:
The created component hierarchy.
Throws:
java.lang.Exception

createBindings

public java.lang.Object[] createBindings()
                                  throws java.lang.Exception
Creates the bindings.

Throws:
java.lang.Exception
Since:
5.0

getComponent

public java.awt.Component getComponent(java.lang.String name)
                                throws NoSuchComponentException
Returns the component for the specified name.

Specified by:
getComponent in interface com.jformdesigner.runtime.ComponentProvider
Parameters:
name - The name of the component.
Returns:
The component.
Throws:
NoSuchComponentException - If a component with the specified name does not exist or the component is not created.
java.lang.ClassCastException - If the name specifies a non-visual bean.

getBean

public java.lang.Object getBean(java.lang.String name)
                         throws NoSuchComponentException
Returns the bean for the specified name. This can be a visual or a non-visual bean.

Parameters:
name - The name of the bean.
Returns:
The bean.
Throws:
NoSuchComponentException - If a bean with the specified name does not exist or the bean is not created.
Since:
2.0

getBean

public java.lang.Object getBean(java.lang.String name,
                                boolean create)
                         throws java.lang.Exception
Returns the bean for the specified name. This can be a visual or a non-visual bean.

Specified by:
getBean in interface com.jformdesigner.runtime.BeanProvider
Parameters:
name - The name of the bean.
create - If true, create the bean if necessary.
Returns:
The bean.
Throws:
java.lang.Exception
Since:
5.0

getButton

public javax.swing.JButton getButton(java.lang.String name)
                              throws NoSuchComponentException
Returns the component for the specified name.

Parameters:
name - The name of the component.
Returns:
The component.
Throws:
NoSuchComponentException - If a component with the specified name does not exist or the component is not created.
java.lang.ClassCastException - If the component is not a instance of JButton.

getCheckBox

public javax.swing.JCheckBox getCheckBox(java.lang.String name)
                                  throws NoSuchComponentException
Returns the component for the specified name.

Parameters:
name - The name of the component.
Returns:
The component.
Throws:
NoSuchComponentException - If a component with the specified name does not exist or the component is not created.
java.lang.ClassCastException - If the component is not a instance of JCheckBox.

getCheckBoxMenuItem

public javax.swing.JCheckBoxMenuItem getCheckBoxMenuItem(java.lang.String name)
                                                  throws NoSuchComponentException
Returns the component for the specified name.

Parameters:
name - The name of the component.
Returns:
The component.
Throws:
NoSuchComponentException - If a component with the specified name does not exist or the component is not created.
java.lang.ClassCastException - If the component is not a instance of JCheckBoxMenuItem.
Since:
2.0.5

getComboBox

public javax.swing.JComboBox getComboBox(java.lang.String name)
                                  throws NoSuchComponentException
Returns the component for the specified name.

Parameters:
name - The name of the component.
Returns:
The component.
Throws:
NoSuchComponentException - If a component with the specified name does not exist or the component is not created.
java.lang.ClassCastException - If the component is not a instance of JComboBox.

getDialog

public javax.swing.JDialog getDialog(java.lang.String name)
                              throws NoSuchComponentException
Returns the component for the specified name.

Parameters:
name - The name of the component.
Returns:
The component.
Throws:
NoSuchComponentException - If a component with the specified name does not exist or the component is not created.
java.lang.ClassCastException - If the component is not a instance of JDialog.

getEditorPane

public javax.swing.JEditorPane getEditorPane(java.lang.String name)
                                      throws NoSuchComponentException
Returns the component for the specified name.

Parameters:
name - The name of the component.
Returns:
The component.
Throws:
NoSuchComponentException - If a component with the specified name does not exist or the component is not created.
java.lang.ClassCastException - If the component is not a instance of JEditorPane.

getFormattedTextField

public javax.swing.JFormattedTextField getFormattedTextField(java.lang.String name)
                                                      throws NoSuchComponentException
Returns the component for the specified name.

Parameters:
name - The name of the component.
Returns:
The component.
Throws:
NoSuchComponentException - If a component with the specified name does not exist or the component is not created.
java.lang.ClassCastException - If the component is not a instance of JFormattedTextField.

getFrame

public javax.swing.JFrame getFrame(java.lang.String name)
                            throws NoSuchComponentException
Returns the component for the specified name.

Parameters:
name - The name of the component.
Returns:
The component.
Throws:
NoSuchComponentException - If a component with the specified name does not exist or the component is not created.
java.lang.ClassCastException - If the component is not a instance of JFrame.

getLabel

public javax.swing.JLabel getLabel(java.lang.String name)
                            throws NoSuchComponentException
Returns the component for the specified name.

Parameters:
name - The name of the component.
Returns:
The component.
Throws:
NoSuchComponentException - If a component with the specified name does not exist or the component is not created.
java.lang.ClassCastException - If the component is not a instance of JLabel.

getList

public javax.swing.JList getList(java.lang.String name)
                          throws NoSuchComponentException
Returns the component for the specified name.

Parameters:
name - The name of the component.
Returns:
The component.
Throws:
NoSuchComponentException - If a component with the specified name does not exist or the component is not created.
java.lang.ClassCastException - If the component is not a instance of JList.

getMenu

public javax.swing.JMenu getMenu(java.lang.String name)
                          throws NoSuchComponentException
Returns the component for the specified name.

Parameters:
name - The name of the component.
Returns:
The component.
Throws:
NoSuchComponentException - If a component with the specified name does not exist or the component is not created.
java.lang.ClassCastException - If the component is not a instance of JMenu.
Since:
2.0.5

getMenuBar

public javax.swing.JMenuBar getMenuBar(java.lang.String name)
                                throws NoSuchComponentException
Returns the component for the specified name.

Parameters:
name - The name of the component.
Returns:
The component.
Throws:
NoSuchComponentException - If a component with the specified name does not exist or the component is not created.
java.lang.ClassCastException - If the component is not a instance of JMenuBar.
Since:
2.0.5

getMenuItem

public javax.swing.JMenuItem getMenuItem(java.lang.String name)
                                  throws NoSuchComponentException
Returns the component for the specified name.

Parameters:
name - The name of the component.
Returns:
The component.
Throws:
NoSuchComponentException - If a component with the specified name does not exist or the component is not created.
java.lang.ClassCastException - If the component is not a instance of JMenuItem.
Since:
2.0.5

getPanel

public javax.swing.JPanel getPanel(java.lang.String name)
                            throws NoSuchComponentException
Returns the component for the specified name.

Parameters:
name - The name of the component.
Returns:
The component.
Throws:
NoSuchComponentException - If a component with the specified name does not exist or the component is not created.
java.lang.ClassCastException - If the component is not a instance of JPanel.

getPasswordField

public javax.swing.JPasswordField getPasswordField(java.lang.String name)
                                            throws NoSuchComponentException
Returns the component for the specified name.

Parameters:
name - The name of the component.
Returns:
The component.
Throws:
NoSuchComponentException - If a component with the specified name does not exist or the component is not created.
java.lang.ClassCastException - If the component is not a instance of JPasswordField.

getPopupMenu

public javax.swing.JPopupMenu getPopupMenu(java.lang.String name)
                                    throws NoSuchComponentException
Returns the component for the specified name.

Parameters:
name - The name of the component.
Returns:
The component.
Throws:
NoSuchComponentException - If a component with the specified name does not exist or the component is not created.
java.lang.ClassCastException - If the component is not a instance of JPopupMenu.
Since:
2.0.5

getProgressBar

public javax.swing.JProgressBar getProgressBar(java.lang.String name)
                                        throws NoSuchComponentException
Returns the component for the specified name.

Parameters:
name - The name of the component.
Returns:
The component.
Throws:
NoSuchComponentException - If a component with the specified name does not exist or the component is not created.
java.lang.ClassCastException - If the component is not a instance of JProgressBar.

getRadioButton

public javax.swing.JRadioButton getRadioButton(java.lang.String name)
                                        throws NoSuchComponentException
Returns the component for the specified name.

Parameters:
name - The name of the component.
Returns:
The component.
Throws:
NoSuchComponentException - If a component with the specified name does not exist or the component is not created.
java.lang.ClassCastException - If the component is not a instance of JRadioButton.

getRadioButtonMenuItem

public javax.swing.JRadioButtonMenuItem getRadioButtonMenuItem(java.lang.String name)
                                                        throws NoSuchComponentException
Returns the component for the specified name.

Parameters:
name - The name of the component.
Returns:
The component.
Throws:
NoSuchComponentException - If a component with the specified name does not exist or the component is not created.
java.lang.ClassCastException - If the component is not a instance of JRadioButtonMenuItem.
Since:
2.0.5

getScrollBar

public javax.swing.JScrollBar getScrollBar(java.lang.String name)
                                    throws NoSuchComponentException
Returns the component for the specified name.

Parameters:
name - The name of the component.
Returns:
The component.
Throws:
NoSuchComponentException - If a component with the specified name does not exist or the component is not created.
java.lang.ClassCastException - If the component is not a instance of JScrollBar.

getScrollPane

public javax.swing.JScrollPane getScrollPane(java.lang.String name)
                                      throws NoSuchComponentException
Returns the component for the specified name.

Parameters:
name - The name of the component.
Returns:
The component.
Throws:
NoSuchComponentException - If a component with the specified name does not exist or the component is not created.
java.lang.ClassCastException - If the component is not a instance of JScrollPane.

getSeparator

public javax.swing.JSeparator getSeparator(java.lang.String name)
                                    throws NoSuchComponentException
Returns the component for the specified name.

Parameters:
name - The name of the component.
Returns:
The component.
Throws:
NoSuchComponentException - If a component with the specified name does not exist or the component is not created.
java.lang.ClassCastException - If the component is not a instance of JSeparator.

getSlider

public javax.swing.JSlider getSlider(java.lang.String name)
                              throws NoSuchComponentException
Returns the component for the specified name.

Parameters:
name - The name of the component.
Returns:
The component.
Throws:
NoSuchComponentException - If a component with the specified name does not exist or the component is not created.
java.lang.ClassCastException - If the component is not a instance of JSlider.

getSpinner

public javax.swing.JSpinner getSpinner(java.lang.String name)
                                throws NoSuchComponentException
Returns the component for the specified name.

Parameters:
name - The name of the component.
Returns:
The component.
Throws:
NoSuchComponentException - If a component with the specified name does not exist or the component is not created.
java.lang.ClassCastException - If the component is not a instance of JSpinner.

getSplitPane

public javax.swing.JSplitPane getSplitPane(java.lang.String name)
                                    throws NoSuchComponentException
Returns the component for the specified name.

Parameters:
name - The name of the component.
Returns:
The component.
Throws:
NoSuchComponentException - If a component with the specified name does not exist or the component is not created.
java.lang.ClassCastException - If the component is not a instance of JSplitPane.

getTabbedPane

public javax.swing.JTabbedPane getTabbedPane(java.lang.String name)
                                      throws NoSuchComponentException
Returns the component for the specified name.

Parameters:
name - The name of the component.
Returns:
The component.
Throws:
NoSuchComponentException - If a component with the specified name does not exist or the component is not created.
java.lang.ClassCastException - If the component is not a instance of JTabbedPane.

getTable

public javax.swing.JTable getTable(java.lang.String name)
                            throws NoSuchComponentException
Returns the component for the specified name.

Parameters:
name - The name of the component.
Returns:
The component.
Throws:
NoSuchComponentException - If a component with the specified name does not exist or the component is not created.
java.lang.ClassCastException - If the component is not a instance of JTable.

getTextArea

public javax.swing.JTextArea getTextArea(java.lang.String name)
                                  throws NoSuchComponentException
Returns the component for the specified name.

Parameters:
name - The name of the component.
Returns:
The component.
Throws:
NoSuchComponentException - If a component with the specified name does not exist or the component is not created.
java.lang.ClassCastException - If the component is not a instance of JTextArea.

getTextField

public javax.swing.JTextField getTextField(java.lang.String name)
                                    throws NoSuchComponentException
Returns the component for the specified name.

Parameters:
name - The name of the component.
Returns:
The component.
Throws:
NoSuchComponentException - If a component with the specified name does not exist or the component is not created.
java.lang.ClassCastException - If the component is not a instance of JTextField.

getTextPane

public javax.swing.JTextPane getTextPane(java.lang.String name)
                                  throws NoSuchComponentException
Returns the component for the specified name.

Parameters:
name - The name of the component.
Returns:
The component.
Throws:
NoSuchComponentException - If a component with the specified name does not exist or the component is not created.
java.lang.ClassCastException - If the component is not a instance of JTextPane.

getToggleButton

public javax.swing.JToggleButton getToggleButton(java.lang.String name)
                                          throws NoSuchComponentException
Returns the component for the specified name.

Parameters:
name - The name of the component.
Returns:
The component.
Throws:
NoSuchComponentException - If a component with the specified name does not exist or the component is not created.
java.lang.ClassCastException - If the component is not a instance of JToggleButton.

getToolBar

public javax.swing.JToolBar getToolBar(java.lang.String name)
                                throws NoSuchComponentException
Returns the component for the specified name.

Parameters:
name - The name of the component.
Returns:
The component.
Throws:
NoSuchComponentException - If a component with the specified name does not exist or the component is not created.
java.lang.ClassCastException - If the component is not a instance of JToolBar.

getTree

public javax.swing.JTree getTree(java.lang.String name)
                          throws NoSuchComponentException
Returns the component for the specified name.

Parameters:
name - The name of the component.
Returns:
The component.
Throws:
NoSuchComponentException - If a component with the specified name does not exist or the component is not created.
java.lang.ClassCastException - If the component is not a instance of JTree.

getWindow

public javax.swing.JWindow getWindow(java.lang.String name)
                              throws NoSuchComponentException
Returns the component for the specified name.

Parameters:
name - The name of the component.
Returns:
The component.
Throws:
NoSuchComponentException - If a component with the specified name does not exist or the component is not created.
java.lang.ClassCastException - If the component is not a instance of JWindow.

newComponentInstance

protected java.lang.Object newComponentInstance(java.lang.Class<?> beanClass,
                                                java.lang.String compName)
                                         throws java.lang.Exception
Creates a new instance of the given bean class. The default implementation is "return beanClass.newInstance();".

Override this method to implement special component creation.

Parameters:
beanClass - The component class.
compName - The name of the component.
Returns:
A new instance of the component.
Throws:
java.lang.Exception
Since:
3.0

getI18nBundle

protected java.util.ResourceBundle getI18nBundle(java.lang.String baseName,
                                                 java.util.Locale locale,
                                                 java.lang.ClassLoader loader)
Gets the resource bundle for the given base name. The default implementation is "return ResourceBundle.getBundle(baseName, locale, loader);".

Override this method to implement special bundle loading.

Parameters:
baseName - The base name of the resource bundle, a fully qualified class name.
locale - The locale for which a resource bundle is desired.
loader - The class loader from which to load the resource bundle.
Returns:
The resource bundle for the given base name and locale.
Since:
3.0

getI18nString

protected java.lang.String getI18nString(java.util.ResourceBundle bundle,
                                         java.lang.String baseName,
                                         java.lang.String key)
Gets a string for the given key from the given resource bundle or one of its parents. The default implementation is "return bundle.getString(key);".

Override this method to implement special string loading.

Parameters:
bundle - The resource bundle to get the string from.
baseName - The base name of the resource bundle, a fully qualified class name.
key - The key for the desired string.
Returns:
The string for the given key.
Since:
3.0

JFormDesigner 5.0.4 Runtime API

Copyright (C) 2004-2012 FormDev Software GmbH. All rights reserved.