本文整理匯總了Java中javax.swing.JColorChooser.showDialog方法的典型用法代碼示例。如果您正苦於以下問題:Java JColorChooser.showDialog方法的具體用法?Java JColorChooser.showDialog怎麽用?Java JColorChooser.showDialog使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.swing.JColorChooser
的用法示例。
在下文中一共展示了JColorChooser.showDialog方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: jPanelStarColourMouseClicked
import javax.swing.JColorChooser; //導入方法依賴的package包/類
private void jPanelStarColourMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanelStarColourMouseClicked
Color initialBackground = new Color(255, 255, 0);
Color background = JColorChooser.showDialog(null, "Set Colour",
initialBackground);
if ((background != null) && (background != jPanelStarColour.getBackground())) {
stopStarEffect();
gKeyboard.getEffect().StarColour = IOOperations.getHexStringFromColour(background);
gKeyboard.setAllKeys(gKeyboard.getEffect().SkyColour, true);
jPanelStarColour.setBackground(background);
jPanelColour115.setBackground(background);
jLayeredPane1.moveToBack(jPanelColour115);
jPanelColour116.setBackground(background);
jLayeredPane1.moveToBack(jPanelColour116);
gKeyboard.setGroupKeys("logo", gKeyboard.getEffect().StarColour, true);
startStarEffect(gKeyboard.getEffect().StarColour, gKeyboard.getEffect().SkyColour);
}
}
示例2: setColor
import javax.swing.JColorChooser; //導入方法依賴的package包/類
public static void setColor(String inTarget) {
if (inTarget.equals(BACKGROUND)) {
Color backgroundColor = JColorChooser.showDialog(null,
"DataBaseManagerSwing Choose Background Color",
fOwner.txtResult.getBackground());
if (backgroundColor != null) {
bgColorButton.setBackground(backgroundColor);
fOwner.txtCommand.setBackground(backgroundColor);
fOwner.txtResult.setBackground(backgroundColor);
}
} else {
Color foregroundColor = JColorChooser.showDialog(null,
"DataBaseManagerSwing Choose Foreground Color",
fOwner.txtResult.getForeground());
if (foregroundColor != null) {
fgColorButton.setBackground(foregroundColor);
fOwner.txtCommand.setForeground(foregroundColor);
fOwner.txtResult.setForeground(foregroundColor);
}
}
}
示例3: textColor_actionPerformed
import javax.swing.JColorChooser; //導入方法依賴的package包/類
void textColor_actionPerformed(ActionEvent e) {
int i=textColor.getSelectedIndex();
if (i < colors.length){
if(i!=stickerColor.getSelectedIndex()){
stickerText.setForeground(colors[i]);
textColor.setSelectedIndex(i);
}
else{
textColor.setSelectedIndex(i+1);
stickerText.setForeground(colors[i+1]);
JOptionPane.showMessageDialog(this, Local.getString("SAME FOREGROUND COLOR"), "Error", 0);
}
stickerText.setForeground(colors[textColor.getSelectedIndex()]);
}
else {
Color c =
JColorChooser.showDialog(
this,
Local.getString("Text color"),
stickerText.getForeground());
if (c != null)
stickerText.setForeground(c);
}
Context.put("TEXT_COLOR", new Integer(stickerText.getForeground().getRGB()));
}
示例4: colorValue
import javax.swing.JColorChooser; //導入方法依賴的package包/類
/**
* Prompts the user for a colour value
*
* @param name Thename of the value being configured
* @param currentValue The default value that should be selected
* @return The value selected
*/
static public Value colorValue(String name, Color currentValue) {
return new DefaultValue(name, EffectUtil.toString(currentValue)) {
public void showDialog () {
Color newColor = JColorChooser.showDialog(null, "Choose a color", EffectUtil.fromString(value));
if (newColor != null) value = EffectUtil.toString(newColor);
}
public Object getObject () {
return EffectUtil.fromString(value);
}
};
}
示例5: attemptModifySeriesPaint
import javax.swing.JColorChooser; //導入方法依賴的package包/類
/**
* Allows the user the opportunity to change the series label paint.
*/
private void attemptModifySeriesPaint() {
Color c;
c = JColorChooser.showDialog(this, localizationResources.getString("Series_Label_Color"),
Color.blue);
if (c != null) {
this.seriesPaint.setPaint(c);
}
}
示例6: createFrameBackgroundColorDialog
import javax.swing.JColorChooser; //導入方法依賴的package包/類
private void createFrameBackgroundColorDialog() {
Color oldColor = getPlotConfiguration().getChartBackgroundColor();
if (oldColor == null) {
oldColor = Color.white;
}
Color newBackgroundColor = JColorChooser.showDialog(this,
I18N.getGUILabel("plotter.configuration_dialog.global_config_panel.chart_background_color_title.label"),
oldColor);
if (newBackgroundColor != null && !newBackgroundColor.equals(oldColor)) {
getPlotConfiguration().setFrameBackgroundColor(newBackgroundColor);
}
}
示例7: attemptModifyOutlinePaint
import javax.swing.JColorChooser; //導入方法依賴的package包/類
/**
* Allows the user the opportunity to change the outline paint.
*/
private void attemptModifyOutlinePaint() {
Color c;
c = JColorChooser.showDialog(this, localizationResources.getString("Outline_Color"),
Color.blue);
if (c != null) {
this.outlinePaint.setPaint(c);
}
}
示例8: jPanelStarColourMouseClicked
import javax.swing.JColorChooser; //導入方法依賴的package包/類
private void jPanelStarColourMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanelStarColourMouseClicked
Color initialBackground = new Color(255, 255, 0);
Color background = JColorChooser.showDialog(null, "Set Colour",
initialBackground);
if ((background != null) && (background != jPanelStarColour.getBackground())) {
stopStarEffect();
gKeyboard.getEffect().StarColour = IOOperations.getHexStringFromColour(background);
gKeyboard.setAllKeys(gKeyboard.getEffect().SkyColour, true);
jPanelStarColour.setBackground(background);
//jPanelColour115.setBackground(background);
//jLayeredPane1.moveToBack(jPanelColour115);
//gKeyboard.setGroupKeys("logo", gKeyboard.getEffect().StarColour, true);
startStarEffect(gKeyboard.getEffect().StarColour, gKeyboard.getEffect().SkyColour);
}
}
示例9: colorB_actionPerformed
import javax.swing.JColorChooser; //導入方法依賴的package包/類
void colorB_actionPerformed(ActionEvent e) {
// Fix until Sun's JVM supports more locales...
UIManager.put(
"ColorChooser.swatchesNameText",
Local.getString("Swatches"));
UIManager.put("ColorChooser.hsbNameText", Local.getString("HSB"));
UIManager.put("ColorChooser.rgbNameText", Local.getString("RGB"));
UIManager.put(
"ColorChooser.swatchesRecentText",
Local.getString("Recent:"));
UIManager.put("ColorChooser.previewText", Local.getString("Preview"));
UIManager.put(
"ColorChooser.sampleText",
Local.getString("Sample Text")
+ " "
+ Local.getString("Sample Text"));
UIManager.put("ColorChooser.okText", Local.getString("OK"));
UIManager.put("ColorChooser.cancelText", Local.getString("Cancel"));
UIManager.put("ColorChooser.resetText", Local.getString("Reset"));
UIManager.put("ColorChooser.hsbHueText", Local.getString("H"));
UIManager.put("ColorChooser.hsbSaturationText", Local.getString("S"));
UIManager.put("ColorChooser.hsbBrightnessText", Local.getString("B"));
UIManager.put("ColorChooser.hsbRedText", Local.getString("R"));
UIManager.put("ColorChooser.hsbGreenText", Local.getString("G"));
UIManager.put("ColorChooser.hsbBlueText", Local.getString("B2"));
UIManager.put("ColorChooser.rgbRedText", Local.getString("Red"));
UIManager.put("ColorChooser.rgbGreenText", Local.getString("Green"));
UIManager.put("ColorChooser.rgbBlueText", Local.getString("Blue"));
Color c = JColorChooser.showDialog(this, Local.getString("Font color"),
Util.decodeColor(colorField.getText()));
if (c == null) return;
colorField.setText(Util.encodeColor(c));
Util.setColorField(colorField);
sample.setForeground(c);
}
示例10: createLegendFrameColorDialog
import javax.swing.JColorChooser; //導入方法依賴的package包/類
private void createLegendFrameColorDialog() {
Color oldColor = getPlotConfiguration().getLegendConfiguration().getLegendFrameColor();
if (oldColor == null) {
oldColor = LegendConfiguration.DEFAULT_LEGEND_FRAME_COLOR;
}
Color newBackgroundColor = JColorChooser.showDialog(this,
I18N.getGUILabel("plotter.configuration_dialog.global_config_panel.legend_frame_color_title.label"),
oldColor);
if (newBackgroundColor != null && !(newBackgroundColor.equals(oldColor))) {
getPlotConfiguration().getLegendConfiguration().setLegendFrameColor(newBackgroundColor);
}
}
示例11: actionPerformed
import javax.swing.JColorChooser; //導入方法依賴的package包/類
public void actionPerformed(ActionEvent e) {
if (!colorChooserEnabled) {
return;
}
Color c = JColorChooser.showDialog(this, "Choose color", color);
if (c != null) {
setColor(c);
}
}
示例12: jPanelSkyColourMouseClicked
import javax.swing.JColorChooser; //導入方法依賴的package包/類
private void jPanelSkyColourMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jPanelSkyColourMouseClicked
Color initialBackground = new Color(0, 0, 0);
Color background = JColorChooser.showDialog(null, "Set Colour",
initialBackground);
if ((background != null) && (background != jPanelSkyColour.getBackground())) {
stopStarEffect();
gKeyboard.getEffect().SkyColour = IOOperations.getHexStringFromColour(background);
gKeyboard.setAllKeys(gKeyboard.getEffect().SkyColour, true);
jPanelSkyColour.setBackground(background);
//jPanelColour115.setBackground(jPanelStarColour.getBackground());
//jLayeredPane1.moveToBack(jPanelColour115);
//gKeyboard.setGroupKeys("logo", gKeyboard.getEffect().StarColour, true);
startStarEffect(gKeyboard.getEffect().StarColour, IOOperations.getHexStringFromColour(background));
}
}
示例13: jTextField5MouseClicked
import javax.swing.JColorChooser; //導入方法依賴的package包/類
private void jTextField5MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextField5MouseClicked
Color color = JColorChooser.showDialog(this, "Select Color", jTextField5.getBackground()) ;
jTextField5.setBackground(color); unselected = color ;
this.tabPane.setUI(new CustomTabbedPaneUI(selected, color, gradient));
}
示例14: jTextField18MouseClicked
import javax.swing.JColorChooser; //導入方法依賴的package包/類
private void jTextField18MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTextField18MouseClicked
Color color = JColorChooser.showDialog(this, "Select Color", jTextField18.getBackground()) ;
jTextField18.setBackground(color); //display.setMatchedBracketBGColor(color); display2.setMatchedBracketBGColor(color);
secondaryLanguages[2] = color ;
}
示例15: tdBgcolorB_actionPerformed
import javax.swing.JColorChooser; //導入方法依賴的package包/類
void tdBgcolorB_actionPerformed(ActionEvent e) {
Color c = JColorChooser.showDialog(this, Local.getString("Table cell background color"), Util.decodeColor(tdBgcolorField.getText()));
if (c == null) return;
tdBgcolorField.setText(Util.encodeColor(c));
Util.setBgcolorField(tdBgcolorField);
}