本文整理匯總了Java中com.sun.swingset3.utilities.GradientPanel類的典型用法代碼示例。如果您正苦於以下問題:Java GradientPanel類的具體用法?Java GradientPanel怎麽用?Java GradientPanel使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
GradientPanel類屬於com.sun.swingset3.utilities包,在下文中一共展示了GradientPanel類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createTitleArea
import com.sun.swingset3.utilities.GradientPanel; //導入依賴的package包/類
protected JComponent createTitleArea(String demoSetTitle) {
JPanel titleAreaPanel = new JPanel(new BorderLayout());
titlePanel = new GradientPanel(
UIManager.getColor(SwingSet3.TITLE_GRADIENT_COLOR1_KEY),
UIManager.getColor(SwingSet3.TITLE_GRADIENT_COLOR2_KEY));
titlePanel.setLayout(new BorderLayout());
titlePanel.setBorder(panelBorder);
demoListLabel = new JLabel(demoSetTitle);
demoListLabel.setOpaque(false);
demoListLabel.setHorizontalAlignment(JLabel.LEADING);
titlePanel.add(demoListLabel, BorderLayout.CENTER);
titleAreaPanel.add(titlePanel, BorderLayout.NORTH);
// Add panel with view combobox
viewPanel = new JPanel();
viewPanel.setLayout(new BoxLayout(viewPanel, BoxLayout.X_AXIS));
viewPanel.setBorder(new CompoundBorder(chiselBorder,
new EmptyBorder(12,8,12,8)));
JLabel viewLabel = new JLabel("View:");
viewPanel.add(viewLabel);
viewPanel.add(Box.createHorizontalStrut(6));
JComboBox viewComboBox = new JComboBox();
viewComboBox.addItem("by category");
viewPanel.add(viewComboBox);
titleAreaPanel.add(viewPanel, BorderLayout.CENTER);
return titleAreaPanel;
}