當前位置: 首頁>>代碼示例>>Java>>正文


Java JColorChooser.getChooserPanels方法代碼示例

本文整理匯總了Java中javax.swing.JColorChooser.getChooserPanels方法的典型用法代碼示例。如果您正苦於以下問題:Java JColorChooser.getChooserPanels方法的具體用法?Java JColorChooser.getChooserPanels怎麽用?Java JColorChooser.getChooserPanels使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.swing.JColorChooser的用法示例。


在下文中一共展示了JColorChooser.getChooserPanels方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: fixOsxColorChooser

import javax.swing.JColorChooser; //導入方法依賴的package包/類
public static void fixOsxColorChooser(JColorChooser chooser) {

		if(!UIManager.getLookAndFeel().getName().equals("Mac OS X"))
			return;

		AbstractColorChooserPanel[] panels = chooser.getChooserPanels();
		for(JPanel p : panels) {
			if(p!=null) {
				p.setOpaque(false);
				((JComponent) p.getParent()).setOpaque(false);
				for(Component c : p.getComponents()) {
					((JComponent) c).setBorder(null);
					((JComponent) c).setOpaque(false);
				}
			}
		}
	}
 
開發者ID:CalebKussmaul,項目名稱:GIFKR,代碼行數:18,代碼來源:ViewUtils.java

示例2: showDialog

import javax.swing.JColorChooser; //導入方法依賴的package包/類
public static Color showDialog(Component component, String title,
        Color initial) {
    JColorChooser choose = new JColorChooser(initial);

    JDialog dialog = createDialog(component, title, true, choose, null, null);

    AbstractColorChooserPanel[] panels = choose.getChooserPanels();
    for (AbstractColorChooserPanel accp : panels) {
        choose.removeChooserPanel(accp);
    }
    GrayScaleSwatchChooserPanel grayScaleSwatchChooserPanelFreeStyle = new GrayScaleSwatchChooserPanel();
    GrayScalePanel grayScalePanelFreeStyle = new GrayScalePanel();
    choose.addChooserPanel(grayScaleSwatchChooserPanelFreeStyle);
    choose.addChooserPanel(grayScalePanelFreeStyle);

    dialog.getContentPane().add(choose);
    dialog.pack();
    dialog.setVisible(true);//.show();

    return choose.getColor();
}
 
開發者ID:MohamadSaada,項目名稱:LogiGSK,代碼行數:22,代碼來源:JColorChooserGrayScale.java

示例3: main

import javax.swing.JColorChooser; //導入方法依賴的package包/類
public static void main(String[] args) throws Exception {
    JColorChooser chooser = new JColorChooser();
    AbstractColorChooserPanel[] panels = chooser.getChooserPanels();
    chooser.setChooserPanels(new AbstractColorChooserPanel[] { panels[1] });

    JDialog dialog = show(chooser);
    pause(DELAY);

    dialog.dispose();
    pause(DELAY);

    Test4177735 test = new Test4177735();
    SwingUtilities.invokeAndWait(test);
    if (test.count != 0) {
        throw new Error("JColorChooser leaves " + test.count + " threads running");
    }
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:18,代碼來源:Test4177735.java

示例4: findPanel

import javax.swing.JColorChooser; //導入方法依賴的package包/類
public static AbstractColorChooserPanel findPanel(JColorChooser chooser, String name) {
	AbstractColorChooserPanel[] panels = chooser.getChooserPanels();
	for (int i = 0; i < panels.length; i++) {
		String clsName = panels[i].getClass().getName();
		if (clsName.equals(name)) {
			return panels[i];
		}
	}
	return null;
}
 
開發者ID:CalebKussmaul,項目名稱:GIFKR,代碼行數:11,代碼來源:ViewUtils.java

示例5: main

import javax.swing.JColorChooser; //導入方法依賴的package包/類
public static void main(String[] args) throws Exception {
    int hsvIndex = 0;
    int panelsLength;
    int finalIndex;
    JColorChooser chooser = new JColorChooser();
    AbstractColorChooserPanel[] panels = chooser.getChooserPanels();
    panelsLength = panels.length;

    for(int i = 0; i < panelsLength; i++) {
        if(panels[i].getDisplayName().equals("HSV")) {
            hsvIndex = i;
        }
    }
    finalIndex = Math.min(hsvIndex, panelsLength - 1);
    chooser.setChooserPanels(new AbstractColorChooserPanel[] { panels[finalIndex] });

    JDialog dialog = show(chooser);
    pause(DELAY);

    dialog.dispose();
    pause(DELAY);

    Test4177735 test = new Test4177735();
    SwingUtilities.invokeAndWait(test);
    if (test.count != 0) {
        throw new Error("JColorChooser leaves " + test.count + " threads running");
    }
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:29,代碼來源:Test4177735.java

示例6: main

import javax.swing.JColorChooser; //導入方法依賴的package包/類
public static void main(String[] args) {
    JColorChooser chooser = new JColorChooser();
    AbstractColorChooserPanel[] panels = chooser.getChooserPanels();
    chooser.removeChooserPanel(panels[0]);
    chooser.updateUI();
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:7,代碼來源:Test4711996.java


注:本文中的javax.swing.JColorChooser.getChooserPanels方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。