当前位置: 首页>>代码示例>>Java>>正文


Java WebLabel.setForeground方法代码示例

本文整理汇总了Java中com.alee.laf.label.WebLabel.setForeground方法的典型用法代码示例。如果您正苦于以下问题:Java WebLabel.setForeground方法的具体用法?Java WebLabel.setForeground怎么用?Java WebLabel.setForeground使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.alee.laf.label.WebLabel的用法示例。


在下文中一共展示了WebLabel.setForeground方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: FlyweightContactItem

import com.alee.laf.label.WebLabel; //导入方法依赖的package包/类
FlyweightContactItem() {
    //this.setPaintFocus(true);
    this.setLayout(new BorderLayout(View.GAP_DEFAULT, 0));
    this.setMargin(View.MARGIN_SMALL);

    mAvatar = new ComponentUtils.AvatarImage(View.AVATAR_LIST_SIZE);
    this.add(mAvatar, BorderLayout.WEST);

    mNameLabel = new WebLabel();
    mNameLabel.setFontSize(View.FONT_SIZE_BIG);
    mNameLabel.setDrawShade(true);

    mStatusLabel = new WebLabel();
    mStatusLabel.setForeground(Color.GRAY);
    mStatusLabel.setFontSize(View.FONT_SIZE_TINY);
    this.add(
            new GroupPanel(View.GAP_SMALL, false,
                    mNameLabel,
                    new GroupPanel(GroupingType.fillFirst,
                            Box.createGlue(), mStatusLabel)
            ), BorderLayout.CENTER);
}
 
开发者ID:kontalk,项目名称:desktopclient-java,代码行数:23,代码来源:ContactListView.java

示例2: CellRenderer

import com.alee.laf.label.WebLabel; //导入方法依赖的package包/类
CellRenderer() {
    mNameLabel = new WebLabel();
    mRoleLabel = new WebLabel();
    mRoleLabel.setForeground(View.DARK_GREEN);

    this.setMargin(View.MARGIN_DEFAULT);
    this.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, Color.LIGHT_GRAY));

    this.add(new GroupPanel(GroupingType.fillMiddle, View.GAP_DEFAULT,
            mNameLabel, Box.createGlue(), mRoleLabel),
            BorderLayout.CENTER);
}
 
开发者ID:kontalk,项目名称:desktopclient-java,代码行数:13,代码来源:ComponentUtils.java

示例3: FlyweightChatItem

import com.alee.laf.label.WebLabel; //导入方法依赖的package包/类
FlyweightChatItem() {
    this.setLayout(new BorderLayout(View.GAP_DEFAULT, 0));
    this.setMargin(View.MARGIN_DEFAULT);

    mAvatar = new ComponentUtils.AvatarImage(View.AVATAR_LIST_SIZE);
    this.add(mAvatar, BorderLayout.WEST);

    mTitleLabel = new WebLabel();
    mTitleLabel.setFontSize(View.FONT_SIZE_BIG);
    mTitleLabel.setDrawShade(true);

    mStatusLabel = new WebLabel();
    mStatusLabel.setForeground(Color.GRAY);
    mStatusLabel.setFontSize(View.FONT_SIZE_TINY);
    this.add(mStatusLabel, BorderLayout.EAST);

    mChatStateLabel = new WebLabel();
    mChatStateLabel.setForeground(View.DARK_RED);
    mChatStateLabel.setFontSize(View.FONT_SIZE_TINY);
    mChatStateLabel.setBoldFont();
    //mChatStateLabel.setMargin(0, 5, 0, 5);

    this.add(
            new GroupPanel(View.GAP_SMALL, false,
                    mTitleLabel,
                    new GroupPanel(GroupingType.fillFirst,
                            Box.createGlue(), mStatusLabel, mChatStateLabel)
            ), BorderLayout.CENTER);
}
 
开发者ID:kontalk,项目名称:desktopclient-java,代码行数:30,代码来源:ChatListView.java

示例4: showPasswordDialog

import com.alee.laf.label.WebLabel; //导入方法依赖的package包/类
void showPasswordDialog(boolean wasWrong) {
    WebPanel passPanel = new WebPanel();
    WebLabel passLabel = new WebLabel(Tr.tr("Please enter your key password:"));
    passPanel.add(passLabel, BorderLayout.NORTH);
    final WebPasswordField passField = new WebPasswordField();
    passPanel.add(passField, BorderLayout.CENTER);
    if (wasWrong) {
        WebLabel wrongLabel = new WebLabel(Tr.tr("Wrong password"));
        wrongLabel.setForeground(Color.RED);
        passPanel.add(wrongLabel, BorderLayout.SOUTH);
    }
    WebOptionPane passPane = new WebOptionPane(passPanel,
            WebOptionPane.QUESTION_MESSAGE,
            WebOptionPane.OK_CANCEL_OPTION);
    JDialog dialog = passPane.createDialog(mMainFrame, Tr.tr("Enter password"));
    dialog.setModal(true);
    dialog.addWindowFocusListener(new WindowAdapter() {
        @Override
        public void windowGainedFocus(WindowEvent e) {
            passField.requestFocusInWindow();
        }
    });
    // blocking
    LOGGER.info("asking for password…");
    dialog.setVisible(true);

    Object value = passPane.getValue();
    if (value != null && value.equals(WebOptionPane.OK_OPTION))
        mControl.connect(passField.getPassword());
}
 
开发者ID:kontalk,项目名称:desktopclient-java,代码行数:31,代码来源:View.java

示例5: showNotification

import com.alee.laf.label.WebLabel; //导入方法依赖的package包/类
private void showNotification() {
    final WebDialog dialog = new WebDialog();
    dialog.setUndecorated(true);
    dialog.setBackground(Color.BLACK);
    dialog.setBackground(StyleConstants.transparent);

    WebNotificationPopup popup = new WebNotificationPopup(PopupStyle.dark);
    popup.setIcon(Utils.getIcon("kontalk_small.png"));
    popup.setMargin(View.MARGIN_DEFAULT);
    popup.setDisplayTime(6000);
    popup.addNotificationListener(new NotificationListener() {
        @Override
        public void optionSelected(NotificationOption option) {
        }
        @Override
        public void accepted() {
        }
        @Override
        public void closed() {
            dialog.dispose();
        }
    });

    // content
    WebPanel panel = new WebPanel();
    panel.setMargin(View.MARGIN_DEFAULT);
    panel.setOpaque(false);
    WebLabel title = new WebLabel("A new Message!");
    title.setFontSize(View.FONT_SIZE_BIG);
    title.setForeground(Color.WHITE);
    panel.add(title, BorderLayout.NORTH);
    String text = "this is some message, and some longer text was added";
    WebLabel message = new WebLabel(text);
    message.setForeground(Color.WHITE);
    panel.add(message, BorderLayout.CENTER);
    popup.setContent(panel);

    //popup.packPopup();
    dialog.setSize(popup.getPreferredSize());

    // set position on screen
    GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
    GraphicsDevice gd = ge.getDefaultScreenDevice();
    GraphicsConfiguration gc = gd.getDefaultConfiguration();
    Rectangle screenBounds = gc.getBounds();
    // get height of the task bar
    // doesn't work on all environments
    //Insets toolHeight = toolkit.getScreenInsets(popup.getGraphicsConfiguration());
    int toolHeight  = 40;
    dialog.setLocation(screenBounds.width - dialog.getWidth() - 10,
            screenBounds.height - toolHeight - dialog.getHeight());

    dialog.setVisible(true);
    NotificationManager.showNotification(dialog, popup);
}
 
开发者ID:kontalk,项目名称:desktopclient-java,代码行数:56,代码来源:Notifier.java


注:本文中的com.alee.laf.label.WebLabel.setForeground方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。