本文整理匯總了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);
}