当前位置: 首页>>代码示例>>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;未经允许,请勿转载。