本文整理匯總了Java中javax.swing.JComponent.setMinimumSize方法的典型用法代碼示例。如果您正苦於以下問題:Java JComponent.setMinimumSize方法的具體用法?Java JComponent.setMinimumSize怎麽用?Java JComponent.setMinimumSize使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.swing.JComponent
的用法示例。
在下文中一共展示了JComponent.setMinimumSize方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: decorateJComponent
import javax.swing.JComponent; //導入方法依賴的package包/類
private void decorateJComponent(JComponent component) {
String prop = (String)component.getClientProperty("com.rapidminer.ui.label.type");
if("header".equals(prop)) {
component.setFont(OPEN_SANS_LIGHT_28);
component.setForeground(SwingTools.RAPIDMINER_ORANGE);
} else if("bold".equals(prop)) {
component.setFont(OPEN_SANS_SEMIBOLD_14);
component.setForeground(Color.DARK_GRAY);
} else if("normal".equals(prop)) {
component.setFont(OPEN_SANS_LIGHT_14);
component.setForeground(Color.DARK_GRAY);
} else if("large".equals(prop)) {
component.setFont(OPEN_SANS_SEMIBOLD_16);
component.setForeground(Color.DARK_GRAY);
}
prop = (String)component.getClientProperty("com.rapidminer.ui.button.type");
if("cfa".equals(prop)) {
component.setFont(OPEN_SANS_SEMIBOLD_14);
component.setBorder(BorderFactory.createEmptyBorder(5, 15, 5, 15));
} else if("normal".equals(prop)) {
component.setFont(OPEN_SANS_LIGHT_14);
component.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
component.setMinimumSize(new Dimension(175, component.getPreferredSize().height));
component.setPreferredSize(new Dimension(175, component.getPreferredSize().height));
}
prop = (String)component.getClientProperty("com.rapidmniner.ui.link_button.id");
if(prop != null && component instanceof LinkButton) {
((LinkButton)component).setText(this.generateHTML(prop));
}
Color foregroundColor = (Color)component.getClientProperty("com.rapidminer.ui.label.foreground");
if(foregroundColor != null) {
component.setForeground(foregroundColor);
}
}
示例2: setSize
import javax.swing.JComponent; //導入方法依賴的package包/類
public static void setSize(JComponent component, Dimension dimension) {
component.setMinimumSize(dimension);
component.setPreferredSize(dimension);
}