本文整理汇总了Java中com.intellij.ui.components.JBLabel.setHorizontalAlignment方法的典型用法代码示例。如果您正苦于以下问题:Java JBLabel.setHorizontalAlignment方法的具体用法?Java JBLabel.setHorizontalAlignment怎么用?Java JBLabel.setHorizontalAlignment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.ui.components.JBLabel
的用法示例。
在下文中一共展示了JBLabel.setHorizontalAlignment方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: SystemImagePreview
import com.intellij.ui.components.JBLabel; //导入方法依赖的package包/类
public SystemImagePreview(@Nullable Disposable disposable) {
myDisposable = disposable;
myRootPanel.setLayout(new CardLayout());
myReleaseName.setFont(AvdWizardConstants.TITLE_FONT);
myApiLevel.setFont(AvdWizardConstants.TITLE_FONT);
myAndroidVersion.setFont(AvdWizardConstants.TITLE_FONT);
myVendor.setFont(AvdWizardConstants.TITLE_FONT);
myDocumentationLink.setOpaque(false);
myAbi.setFont(AvdWizardConstants.TITLE_FONT);
myRootPanel.add(myMainPanel, MAIN_CONTENT);
JPanel nonePanel = new JPanel(new BorderLayout());
JBLabel noneLabel = new JBLabel(NO_SYSTEM_IMAGE_SELECTED);
noneLabel.setHorizontalAlignment(JBLabel.CENTER);
nonePanel.add(noneLabel, BorderLayout.CENTER);
nonePanel.setBackground(JBColor.WHITE);
myRootPanel.add(nonePanel, NO_IMAGE_CONTENT);
myMainPanel.setBackground(JBColor.WHITE);
mySeparator.setForeground(JBColor.BLACK);
myDocumentationLink.addHyperlinkListener(myApiLevelListener);
myDocumentationLink.setHtmlText("See the <a>API level distribution chart</a>");
}
示例2: TipPanel
import com.intellij.ui.components.JBLabel; //导入方法依赖的package包/类
public TipPanel() {
setLayout(new BorderLayout());
JLabel jlabel = new JLabel(AllIcons.General.Tip);
jlabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5));
JLabel label1 = new JLabel(IdeBundle.message("label.did.you.know"));
Font font = label1.getFont();
label1.setFont(font.deriveFont(Font.PLAIN, font.getSize() + 4));
JPanel jpanel = new JPanel();
jpanel.setLayout(new BorderLayout());
jpanel.add(jlabel, BorderLayout.WEST);
jpanel.add(label1, BorderLayout.CENTER);
jpanel.setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 0));
add(jpanel, BorderLayout.NORTH);
myBrowser = TipUIUtil.createTipBrowser();
JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myBrowser);
add(scrollPane, BorderLayout.CENTER);
JPanel southPanel = new JPanel(new BorderLayout());
JCheckBox showOnStartCheckBox = new JCheckBox(IdeBundle.message("checkbox.show.tips.on.startup"), true);
showOnStartCheckBox.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));
final GeneralSettings settings = GeneralSettings.getInstance();
showOnStartCheckBox.setSelected(settings.isShowTipsOnStartup());
showOnStartCheckBox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(@NotNull ItemEvent e) {
settings.setShowTipsOnStartup(e.getStateChange() == ItemEvent.SELECTED);
}
});
southPanel.add(showOnStartCheckBox, BorderLayout.WEST);
myPoweredByLabel = new JBLabel();
myPoweredByLabel.setHorizontalAlignment(SwingConstants.RIGHT);
myPoweredByLabel.setForeground(SimpleTextAttributes.GRAY_ITALIC_ATTRIBUTES.getFgColor());
southPanel.add(myPoweredByLabel, BorderLayout.EAST);
add(southPanel, BorderLayout.SOUTH);
Collections.addAll(myTips, Extensions.getExtensions(TipAndTrickBean.EP_NAME));
}
示例3: HaxmAlert
import com.intellij.ui.components.JBLabel; //导入方法依赖的package包/类
public HaxmAlert() {
myErrorInstructionsLink = new HyperlinkLabel();
myWarningMessage = new JBLabel() {
@Override
public Dimension getPreferredSize() {
// Since this contains auto-wrapped text, the preferred height will not be set until repaint(). The below will set it as soon
// as the actual width is known. This allows the wizard dialog to be set to the correct size even before this step is shown.
final View view = (View)getClientProperty("html");
Component parent = getParent();
if (view != null && parent != null && parent.getWidth() > 0) {
view.setSize(parent.getWidth(), 0);
return new Dimension((int)view.getPreferredSpan(View.X_AXIS), (int)view.getPreferredSpan(View.Y_AXIS));
}
return super.getPreferredSize();
}
};
this.setLayout(new GridLayoutManager(2, 1));
GridConstraints constraints = new GridConstraints();
constraints.setAnchor(GridConstraints.ANCHOR_WEST);
add(myWarningMessage, constraints);
constraints.setRow(1);
add(myErrorInstructionsLink, constraints);
myErrorInstructionsLink.setOpaque(false);
myWarningMessage.setForeground(JBColor.RED);
myWarningMessage.setHorizontalAlignment(SwingConstants.LEFT);
setOpaque(false);
this.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder("Recommendation"),
BorderFactory.createEmptyBorder(0, 5, 3, 5)));
}
示例4: MyDividerPainter
import com.intellij.ui.components.JBLabel; //导入方法依赖的package包/类
public MyDividerPainter() {
myLabel = new JBLabel();
myLabel.setFont(UIUtil.getLabelFont());
myLabel.setHorizontalAlignment(SwingConstants.CENTER);
myLabel.setVerticalAlignment(SwingConstants.TOP);
}