本文整理匯總了Java中org.jfree.ui.RefineryUtilities.createJLabel方法的典型用法代碼示例。如果您正苦於以下問題:Java RefineryUtilities.createJLabel方法的具體用法?Java RefineryUtilities.createJLabel怎麽用?Java RefineryUtilities.createJLabel使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jfree.ui.RefineryUtilities
的用法示例。
在下文中一共展示了RefineryUtilities.createJLabel方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: AboutPanel
import org.jfree.ui.RefineryUtilities; //導入方法依賴的package包/類
/**
* Constructs a panel.
*
* @param application the application name.
* @param version the version.
* @param copyright the copyright statement.
* @param info other info.
* @param logo an optional logo.
*/
public AboutPanel(final String application,
final String version,
final String copyright,
final String info,
final Image logo) {
setLayout(new BorderLayout());
final JPanel textPanel = new JPanel(new GridLayout(4, 1, 0, 4));
final JPanel appPanel = new JPanel();
final Font f1 = new Font("Dialog", Font.BOLD, 14);
final JLabel appLabel = RefineryUtilities.createJLabel(application, f1, Color.black);
appLabel.setHorizontalTextPosition(SwingConstants.CENTER);
appPanel.add(appLabel);
final JPanel verPanel = new JPanel();
final Font f2 = new Font("Dialog", Font.PLAIN, 12);
final JLabel verLabel = RefineryUtilities.createJLabel(version, f2, Color.black);
verLabel.setHorizontalTextPosition(SwingConstants.CENTER);
verPanel.add(verLabel);
final JPanel copyrightPanel = new JPanel();
final JLabel copyrightLabel = RefineryUtilities.createJLabel(copyright, f2, Color.black);
copyrightLabel.setHorizontalTextPosition(SwingConstants.CENTER);
copyrightPanel.add(copyrightLabel);
final JPanel infoPanel = new JPanel();
final JLabel infoLabel = RefineryUtilities.createJLabel(info, f2, Color.black);
infoLabel.setHorizontalTextPosition(SwingConstants.CENTER);
infoPanel.add(infoLabel);
textPanel.add(appPanel);
textPanel.add(verPanel);
textPanel.add(copyrightPanel);
textPanel.add(infoPanel);
add(textPanel);
if (logo != null) {
final JPanel imagePanel = new JPanel(new BorderLayout());
imagePanel.add(new javax.swing.JLabel(new javax.swing.ImageIcon(logo)));
imagePanel.setBorder(BorderFactory.createLineBorder(Color.black));
final JPanel imageContainer = new JPanel(new BorderLayout());
imageContainer.add(imagePanel, BorderLayout.NORTH);
add(imageContainer, BorderLayout.WEST);
}
}