📄 e882. setting the order of the color chooser panel tabs in a jcolorchooser dialog.txt
字号:
The default order of chooser panels is: swatch chooser, HSB chooser, and RGB chooser. This example demonstrates how to change the ordering.
JColorChooser chooser = new JColorChooser();
// Retrieve the number of panels
int numPanels = chooser.getChooserPanels().length;
// Create an array with the desired order of panels
// findPanel() is defined in
// e880 Retrieving the Color Chooser Panels in a JColorChooser Dialog.
AbstractColorChooserPanel[] newPanels = new AbstractColorChooserPanel[numPanels];
newPanels[0] = findPanel(chooser, "javax.swing.colorchooser.DefaultHSBChooserPanel");
newPanels[1] = findPanel(chooser, "javax.swing.colorchooser.DefaultRGBChooserPanel");
newPanels[2] = findPanel(chooser, "javax.swing.colorchooser.DefaultSwatchChooserPanel");
// Set the new order of panels
chooser.setChooserPanels(newPanels);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -