import javax.swing.JComboBox;\r
import javax.swing.JList;\r
import javax.swing.JOptionPane;\r
+import javax.swing.JTable;\r
\r
import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;\r
import org.tianocore.MsaHeaderDocument.MsaHeader;\r
resizeComponentWidth(c, containerWidth, preferredWidth);\r
resizeComponentHeight(c, containerHeight, preferredHeight);\r
}\r
+ \r
+ /**\r
+ To adjust each column's width to meet the table's size\r
+ \r
+ @param t the table need to be adjusted\r
+ @param width the new width of the table\r
+ \r
+ **/\r
+ public static void resizeTableColumn(JTable t, int width) {\r
+ if (t != null) {\r
+ int columnCount = t.getColumnCount();\r
+ for (int index = 0; index < columnCount; index++) {\r
+ t.getColumn(t.getColumnName(index)).setPreferredWidth(width / columnCount);\r
+ }\r
+ }\r
+ }\r
\r
/**\r
* To relocate the input component\r