Java tutorial
//package com.java2s; import java.awt.Dimension; import java.awt.Font; import javax.swing.JComboBox; public class Main { public static void setComboLayout(JComboBox<?> combo, int w, int h, String name) { combo.setPreferredSize(getControlDimension(w, h)); combo.setMinimumSize(getControlDimension(w, h)); combo.setFont(getFont()); combo.setName(name); } public static Dimension getControlDimension(int w, int h) { return new Dimension(w, h); } public static Font getFont() { return new Font("Arial", Font.PLAIN, 10); } }