當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。