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


Java JWindow.setOpacity方法代码示例

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


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

示例1: AutoSuggestor

import javax.swing.JWindow; //导入方法依赖的package包/类
/**
 * Istanzia il suggeritore su un componente testo
 *
 * @param textComp finestra di testo su cui istanziare il suggeritore
 * @param mainWindow finestra principale
 * @param words lista di parole
 * @param popUpBackground colore dello sfondo
 * @param textColor colore del testo
 * @param suggestionFocusedColor colore del suggeritore
 * @param opacity indice di opacità
 */
public AutoSuggestor(JTextComponent textComp, Window mainWindow, List<String> words, Color popUpBackground, Color textColor, Color suggestionFocusedColor, float opacity) {
    this.textComp = textComp;
    this.suggestionsTextColor = textColor;
    this.container = mainWindow;
    this.suggestionFocusedColor = suggestionFocusedColor;
    this.textComp.getDocument().addDocumentListener(documentListener);

    setDictionary(words);

    typedWord = "";
    currentIndexOfSpace = 0;
    tW = 0;
    tH = 0;

    autoSuggestionPopUpWindow = new JWindow(mainWindow);
    autoSuggestionPopUpWindow.setOpacity(opacity);

    suggestionsPanel = new JPanel();
    suggestionsPanel.setLayout(new GridLayout(0, 1));
    suggestionsPanel.setBackground(popUpBackground);
    suggestionsPanel.setBorder(new LineBorder(Color.black));

    addKeyBindingToRequestFocusInPopUpWindow();
}
 
开发者ID:fiohol,项目名称:theSemProject,代码行数:36,代码来源:AutoSuggestor.java

示例2: start

import javax.swing.JWindow; //导入方法依赖的package包/类
/** Start the bot. */
public void start() {
    Toolkit tk = Toolkit.getDefaultToolkit();
    int xSize = ((int) tk.getScreenSize().getWidth());
    int ySize = ((int) tk.getScreenSize().getHeight());
    window = new JWindow();
    window.setSize(xSize, ySize);
    window.setOpacity(0.0f);
    window.setVisible(true);
    window.setAlwaysOnTop(true);
    window.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent e) {
            if (clicks < _numberOfLocations) {
                location[clicks] = getLocation();
                window.setVisible(false);
                sleep();
                click();
                sleep();
                window.setVisible(true);
                sleep();
                clicks += 1;
            }
            if (clicks == _numberOfLocations) {
                window.setVisible(false);
                process();
            }
        }
    });
}
 
开发者ID:jenyeu,项目名称:clickbot,代码行数:31,代码来源:Bot.java


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