List of usage examples for javax.swing JComponent getComponentCount
public int getComponentCount()
From source file:org.openmicroscopy.shoola.agents.util.ui.ScriptComponent.java
/** * Iterates through the components and sets the background color. * /* w w w .j av a 2s . c o m*/ * @param c The component to handle * @param background The color to set. */ private void setComponentColor(JComponent c, Color background) { c.setBackground(background); if (c.getComponentCount() > 0) { Component[] components = c.getComponents(); for (int i = 0; i < components.length; i++) { if (components[i] instanceof JComponent) { setComponentColor((JComponent) components[i], background); } } } }
From source file:org.xulux.swing.util.NativeWidgetHandler.java
/** * @see org.xulux.nyx.gui.INativeWidgetHandler#setLocationOnWidget(org.xulux.nyx.gui.Widget, int, int) */// w w w .jav a2s . co m public void setLocationOnWidget(Widget parent, int x, int y) { if (parent != null && parent.getNativeWidget() != null) { JComponent comp = (JComponent) parent.getNativeWidget(); // set the location on the last component added.. if (comp.getComponentCount() > 0) { Component childComp = comp.getComponent(comp.getComponentCount() - 1); setLocationOnWidget(childComp, x, y); } } }