List of utility methods to do JComponent Size
void | setMinimumSize(JComponent component, int numChars) set Minimum Size int width = calculateCharWidth(component, numChars); if (width > 0) { Dimension current = component.getPreferredSize(); Dimension d = new Dimension(width, current.height); component.setPreferredSize(d); |
Dimension | setPreferredSize(JComponent comp, int height, int width) set Preferred Size Dimension result = null; Dimension preferredSize = comp.getPreferredSize(); if (height != LEAVE) preferredSize.height = height; if (width != LEAVE) preferredSize.width = width; comp.setPreferredSize(preferredSize); result = preferredSize; ... |
void | setSize(Dimension size, JComponent[] components) set Size for (JComponent component : components) {
component.setSize(size);
|
void | setSize(final Component component, final int width, final int height) set Size if (component != null && width >= 0 && height >= 0) { runInEDT(() -> { component.setMaximumSize(new Dimension(width, height)); component.setMinimumSize(new Dimension(width, height)); component.setPreferredSize(new Dimension(width, height)); component.setSize(new Dimension(width, height)); }); |
void | setSize(JComponent c, int w) set Size Dimension d = new Dimension(w, c.getPreferredSize().height);
c.setMinimumSize(d);
c.setPreferredSize(d);
c.setMaximumSize(d);
|
JComponent | setSize(JComponent comp, int w, int h) Set the size and preferred size of the component and return it comp.setSize(w, h); comp.setPreferredSize(new Dimension(w, h)); return comp; |
void | setSize(JComponent componenet, Dimension dimension) set Size componenet.setMinimumSize(dimension); componenet.setMaximumSize(dimension); componenet.setPreferredSize(dimension); |
void | setSize(JComponent componenet, Dimension dimension) setButtonOk componenet.setMinimumSize(dimension); componenet.setMaximumSize(dimension); componenet.setPreferredSize(dimension); |
void | setSize(JComponent component, int width, int height) set Size Dimension textPanelSize = new Dimension(width, height);
component.setSize(textPanelSize);
component.setPreferredSize(textPanelSize);
component.setMaximumSize(textPanelSize);
component.setMinimumSize(textPanelSize);
|
void | setSize(JComponent conponent, int width, int height) set Size conponent.setMinimumSize(new Dimension(width, height)); conponent.setPreferredSize(new Dimension(width, height)); |