public class PropertyEditor extends JPanel implements TableModelListener
addProperty(JComponent, Object, String) methodsetVisible(boolean) methodaddProperty(JComponent, Object, String)
 method.
 
  String[] fill_values = {"NONE", "HORIZONTAL", "VERTICAL VALUE", "BOTH"};
  JComboBox cb = new JComboBox(fill_values);
  cb.setSelectedItem("VERTICAL VALUE");
  JTextField tf = new JTextField("2");
  PropertyEditor p = new PropertyEditor();
  p.addProperty(cb, "VERTICAL VALUE", "combo box");
  p.addProperty(tf, "2", "text");
  p.setVisible(true);
 JPanel.AccessibleJPanelJComponent.AccessibleJComponentContainer.AccessibleAWTContainerComponent.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategylistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWaccessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description | 
|---|
PropertyEditor()
Create a new editor with default parameters. 
 | 
PropertyEditor(String name)
Create a new editor and associate it with a name. 
 | 
PropertyEditor(String name,
              String property,
              String value)
Create a new editor and customize the columns names for properties and values. 
 | 
| Modifier and Type | Method and Description | 
|---|---|
void | 
addProperty(JComponent co,
           Object value,
           String name)
Add a new Property edited by the desired JComponent to the table. 
 | 
int | 
getColumnWidth(int col)
Return the width of one colum. 
 | 
JComponent | 
getComponentAt(int row)
Return the component at a specified row. 
 | 
AbstractTableModel | 
getModel()
Return the underlying table model. 
 | 
Dimension | 
getPreferredSize()  | 
boolean | 
isEditable()
Return true if this editor is editable. 
 | 
void | 
reset()
Reset the content of the PropertyEditor. 
 | 
void | 
setColumnWidth(int col,
              int width)
Set the width of one colum. 
 | 
void | 
setEditable(boolean edit)
Set the editable property of this editor. 
 | 
void | 
setName(String name)
Set the name of this editor. 
 | 
void | 
setVisible(boolean bool)  | 
void | 
tableChanged(TableModelEvent ev)
Do nothing by default. 
 | 
String | 
toString()
Return the name of the Editor. 
 | 
void | 
updateUI()  | 
getAccessibleContext, getUI, getUIClassID, paramString, setUIaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, updateadd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTreeaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setSize, setSize, show, show, size, transferFocus, transferFocusBackward, transferFocusUpCyclepublic PropertyEditor()
Property EditorProperty
 Value
 public PropertyEditor(String name)
name - the name of the editor.public PropertyEditor(String name, String property, String value)
name - the name of the editor (see toString())property - the property column namevalue - the value column namepublic void addProperty(JComponent co, Object value, String name)
   String[] fill_values = { "NONE", "HORIZONTAL", "VERTICAL VALUE","BOTH" };
   JComboBox cb = new JComboBox(fill_values);
   cb.setSelectedItem("VERTICAL VALUE");
   p.addProperty(cb, cb.getSelectedItem(), "property name");
  In this example, a new property is created with a JComboBox.
 Remarks:
 ExtendedCellEditor class are allowedco - the JComponent used for the propertyvalue - the initial value for the propertyname - the name of the propertypublic String toString()
public JComponent getComponentAt(int row)
row - the rowpublic void tableChanged(TableModelEvent ev)
tableChanged in interface TableModelListenerpublic int getColumnWidth(int col)
col - the colum indexpublic AbstractTableModel getModel()
public void setColumnWidth(int col,
                           int width)
col - the colum indexwidth - the colum widthpublic void setEditable(boolean edit)
edit - true if this Editor is editablepublic void setName(String name)
public boolean isEditable()
public Dimension getPreferredSize()
getPreferredSize in class JComponentpublic void reset()
public void setVisible(boolean bool)
setVisible in class JComponent