List of utility methods to do JComponent Width
void | setPreferredWidth(JComponent comp, int width) Sets preferred width of the component. Dimension size = comp.getPreferredSize(); size.width = width; comp.setPreferredSize(size); |
void | setPreferredWidth(JComponent comp, int width) Set the preferred width on a component int height = comp.getPreferredSize().height; if (!checkHeight(height)) { height = 24; comp.setPreferredSize(new Dimension(width, height)); |
void | setPreferredWidth(JComponent component, int width) set Preferred Width Dimension d = component.getPreferredSize(); d.width = width; component.setPreferredSize(d); |
void | setPreferredWidth(JComponent component, int width) set Preferred Width int height = component.getPreferredSize().height; component.setPreferredSize(new Dimension(width, height)); |
void | setPreferredWidth(JComponent component, int width) set Preferred Width component.setPreferredSize(getPreferredSize(component, width)); |
void | setPrefferedWidth(JComponent c, int w) set Preffered Width c.setPreferredSize(new Dimension(w, (int) c.getPreferredSize().getHeight())); |
JComponent | setZeroWidth(JComponent comp) Sets the preferred width of a component to zero (0). Dimension dims = comp.getPreferredSize();
dims.width = 0;
comp.setPreferredSize(dims);
return comp;
|
void | toFixedDim(JComponent c, int width, int height) to Fixed Dim Dimension dimension = new Dimension(width, height);
c.setPreferredSize(dimension);
c.setMaximumSize(dimension);
c.setMinimumSize(dimension);
|