Set JCheckBox text color

Source code below will show you, how to set JCheckBox text color base on RGB. You can get RGB value for your color using "Color picker" at above.

***************************************************************
COMPLETE SOURCE CODE FOR : SetJCheckBoxTextColor.java
***************************************************************


import javax.swing.JCheckBox;
import javax.swing.JFrame;

import java.awt.Color;
import java.awt.FlowLayout;

public class SetJCheckBoxTextColor
{
public static void main(String[]args)
{
//Create check box with text HI using JCheckBox
JCheckBox checkBox=new JCheckBox("HI");

//Create JFrame with title ( Set JCheckBox text color )
JFrame frame=new JFrame("Set JCheckBox text color");

//Set JFrame layout to FlowLayout
frame.setLayout(new FlowLayout());

//Set color base on RGB
//You can get RGB value for your color at "Color picker" at above
//R=255
//G=0
//B=0
Color color=new Color(255,0,0);

//Set JCheckBox text color to color that you choose
checkBox.setForeground(color);

//Add JCheckBox into JFrame
frame.add(checkBox);

//Set default close operation for JFrame
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

//Set JFrame size
frame.setSize(500,300);

//Make JFrame visible
frame.setVisible(true);
}
}


***************************************************************
JUST COMPILE AND EXECUTE IT
***************************************************************

Set JCheckBox background color

Source code below will show you, how to set JCheckBox background color base on RGB. You can get RGB value for your color using "Color picker" at above.

*************************************************************
COMPLETE SOURCE CODE FOR : SetJCheckBoxBackgroundColor.java
*************************************************************


import javax.swing.JCheckBox;
import javax.swing.JFrame;

import java.awt.Color;
import java.awt.FlowLayout;

public class SetJCheckBoxBackgroundColor
{
public static void main(String[]args)
{
//Create check box with text HI using JCheckBox
JCheckBox checkBox=new JCheckBox("HI");

//Create JFrame with title ( Set JCheckBox background color )
JFrame frame=new JFrame("Set JCheckBox background color");

//Set JFrame layout to FlowLayout
frame.setLayout(new FlowLayout());

//Set color base on RGB
//You can get RGB value for your color at "Color picker" at above
//R=255
//G=0
//B=0
Color color=new Color(255,0,0);

//Set JCheckBox background color to color that you choose
checkBox.setBackground(color);

//Add JCheckBox into JFrame
frame.add(checkBox);

//Set default close operation for JFrame
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

//Set JFrame size
frame.setSize(500,300);

//Make JFrame visible
frame.setVisible(true);
}
}


*************************************************************
JUST COMPILE AND EXECUTE IT
*************************************************************

Set JRadioButton text color

Source code below will show you, how to set JRadioButton text color base on RGB. You can get RGB value for your color using "Color picker" at above.

************************************************************************
COMPLETE SOURCE CODE FOR : SetJRadioButtonTextColor.java
************************************************************************


import javax.swing.JRadioButton;
import javax.swing.JFrame;

import java.awt.Color;
import java.awt.FlowLayout;

public class SetJRadioButtonTextColor
{
public static void main(String[]args)
{
//Create radio button with text HI using JRadioButton
JRadioButton radioButton=new JRadioButton("HI");

//Create JFrame with title ( Set JRadioButton text color )
JFrame frame=new JFrame("Set JRadioButton text color");

//Set JFrame layout to FlowLayout
frame.setLayout(new FlowLayout());

//Set color base on RGB
//You can get RGB value for your color at "Color picker" at above
//R=255
//G=0
//B=0
Color color=new Color(255,0,0);

//Set JRadioButton text color to color that you choose
radioButton.setForeground(color);

//Add JRadioButton into JFrame
frame.add(radioButton);

//Set default close operation for JFrame
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

//Set JFrame size
frame.setSize(500,300);

//Make JFrame visible
frame.setVisible(true);
}
}


************************************************************************
JUST COMPILE AND EXECUTE IT
************************************************************************

Set JRadioButton background color

Source code below will show you, how to set JRadioButton background color base on RGB. You can get RGB value for your color using "Color picker" at above.

*************************************************************************
COMPLETE SOURCE CODE FOR : SetJRadioButtonBackgroundColor.java
*************************************************************************


import javax.swing.JRadioButton;
import javax.swing.JFrame;

import java.awt.Color;
import java.awt.FlowLayout;

public class SetJRadioButtonBackgroundColor
{
public static void main(String[]args)
{
//Create radio button with text HI using JRadioButton
JRadioButton radioButton=new JRadioButton("HI");

//Create JFrame with title ( Set JRadioButton background color )
JFrame frame=new JFrame("Set JRadioButton background color");

//Set JFrame layout to FlowLayout
frame.setLayout(new FlowLayout());

//Set color base on RGB
//You can get RGB value for your color at "Color picker" at above
//R=255
//G=0
//B=0
Color color=new Color(255,0,0);

//Set JRadioButton background color to color that you choose
radioButton.setBackground(color);

//Add JRadioButton into JFrame
frame.add(radioButton);

//Set default close operation for JFrame
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

//Set JFrame size
frame.setSize(500,300);

//Make JFrame visible
frame.setVisible(true);
}
}


*************************************************************************
JUST COMPILE AND EXECUTE IT
*************************************************************************

Set JComboBox text color

Source code below will show you, how to set JComboBox text color base on RGB. You can get RGB value for your color using "Color picker" at above.

*************************************************************************
COMPLETE SOURCE CODE FOR : SetJComboBoxTextColor.java
*************************************************************************


import javax.swing.JComboBox;
import javax.swing.JFrame;

import java.awt.Color;
import java.awt.FlowLayout;

public class SetJComboBoxTextColor
{
public static void main(String[]args)
{
//Create JComboBox contents
String[]comboBoxContents={"Cow","Sheep","Horse"};

//Create comboBox using JComboBox
JComboBox comboBox=new JComboBox(comboBoxContents);

//Create JFrame with title ( Set JComboBox text color )
JFrame frame=new JFrame("Set JComboBox text color");

//Set JFrame layout to FlowLayout
frame.setLayout(new FlowLayout());

//Set color base on RGB
//You can get RGB value for your color at "Color picker" at above
//R=255
//G=0
//B=0
Color color=new Color(255,0,0);

//Set JComboBox text color to color that you choose
comboBox.setForeground(color);

//Add JComboBox into JFrame
frame.add(comboBox);

//Set default close operation for JFrame
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

//Set JFrame size
frame.setSize(500,300);

//Make JFrame visible
frame.setVisible(true);
}
}


*************************************************************************
JUST COMPILE AND EXECUTE IT
*************************************************************************

Set JComboBox background color

Source code below will show you, how to set JComboBox background color base on RGB. You can get RGB value for your color using "Color picker" at above.

*********************************************************************
COMPLETE SOURCE CODE FOR : SetJComboBoxBackgroundColor.java
*********************************************************************


import javax.swing.JComboBox;
import javax.swing.JFrame;

import java.awt.Color;
import java.awt.FlowLayout;

public class SetJComboBoxBackgroundColor
{
public static void main(String[]args)
{
//Create JComboBox contents
String[]comboBoxContents={"Cow","Sheep","Horse"};

//Create comboBox using JComboBox
JComboBox comboBox=new JComboBox(comboBoxContents);

//Create JFrame with title ( Set JComboBox background color )
JFrame frame=new JFrame("Set JComboBox background color");

//Set JFrame layout to FlowLayout
frame.setLayout(new FlowLayout());

//Set color base on RGB
//You can get RGB value for your color at "Color picker" at above
//R=255
//G=0
//B=0
Color color=new Color(255,0,0);

//Set JComboBox background color to color that you choose
comboBox.setBackground(color);

//Add JComboBox into JFrame
frame.add(comboBox);

//Set default close operation for JFrame
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

//Set JFrame size
frame.setSize(500,300);

//Make JFrame visible
frame.setVisible(true);
}
}


*********************************************************************
JUST COMPILE AND EXECUTE IT
*********************************************************************

Set JList text color

Source code below will show you, how to set JList text color base on RGB. You can get RGB value for your color using "Color picker" at above.

**************************************************************************
COMPLETE SOURCE CODE FOR : SetJListTextColor.java
**************************************************************************


import javax.swing.JList;
import javax.swing.JFrame;

import java.awt.Color;
import java.awt.FlowLayout;

public class SetJListTextColor
{
public static void main(String[]args)
{
//Create JList contents
String[]listContents={"Cow","Sheep","Horse"};

//Create list using JList
JList list=new JList(listContents);

//Create JFrame with title ( Set JList text color )
JFrame frame=new JFrame("Set JList text color");

//Set JFrame layout to FlowLayout
frame.setLayout(new FlowLayout());

//Set color base on RGB
//You can get RGB value for your color at "Color picker" at above
//R=255
//G=0
//B=0
Color color=new Color(255,0,0);

//Set JList text color to color that you choose
list.setForeground(color);

//Add JList into JFrame
frame.add(list);

//Set default close operation for JFrame
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

//Set JFrame size
frame.setSize(500,300);

//Make JFrame visible
frame.setVisible(true);
}
}


**************************************************************************
JUST COMPILE AND EXECUTE IT
**************************************************************************

Set JList background color

Source code below will show you, how to set JList background color base on RGB. You can get RGB value for your color using "Color picker" at above.

*******************************************************************
COMPLETE SOURCE CODE FOR : SetJListBackgroundColor.java
*******************************************************************


import javax.swing.JList;
import javax.swing.JFrame;

import java.awt.Color;
import java.awt.FlowLayout;

public class SetJListBackgroundColor
{
public static void main(String[]args)
{
//Create JList contents
String[]listContents={"Cow","Sheep","Horse"};

//Create list using JList
JList list=new JList(listContents);

//Create JFrame with title ( Set JList background color )
JFrame frame=new JFrame("Set JList background color");

//Set JFrame layout to FlowLayout
frame.setLayout(new FlowLayout());

//Set color base on RGB
//You can get RGB value for your color at "Color picker" at above
//R=255
//G=0
//B=0
Color color=new Color(255,0,0);

//Set JList background color to color that you choose
list.setBackground(color);

//Add JList into JFrame
frame.add(list);

//Set default close operation for JFrame
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

//Set JFrame size
frame.setSize(500,300);

//Make JFrame visible
frame.setVisible(true);
}
}


*******************************************************************
JUST COMPILE AND EXECUTE IT
*******************************************************************

Set password symbol or echo character color for JPasswordField

Source code below will show you, how to set JPasswordField echo character color base on RGB. You can get RGB value for your color using "Color picker" at above.

***************************************************************************
COMPLETE SOURCE CODE FOR : SetJPasswordFieldEchoCharacterColor.java
***************************************************************************


import javax.swing.JPasswordField;
import javax.swing.JFrame;

import java.awt.Color;

public class SetJPasswordFieldEchoCharacterColor
{
public static void main(String[]args)
{
//Create password field with number of columns equal to 10
JPasswordField passwordField=new JPasswordField(10);

//Create JFrame with title ( Set JPasswordField echo character color )
JFrame frame=new JFrame("Set JPasswordField echo character color");

//Set color base on RGB
//You can get RGB value for your color at "Color picker" at above
//R=255
//G=0
//B=0
Color color=new Color(255,0,0);

//Set JPasswordField echo character color to color that you choose
passwordField.setForeground(color);

//Add JPasswordField into JFrame
frame.add(passwordField);

//Set default close operation for JFrame
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

//Set JFrame size
frame.setSize(500,65);

//Make JFrame visible
frame.setVisible(true);
}
}


***************************************************************************
JUST COMPILE AND EXECUTE IT
***************************************************************************

Set JPasswordField background color

Source code below will show you, how to set JPasswordField background color base on RGB. You can get RGB value for your color using "Color picker" at above.

****************************************************************************
COMPLETE SOURCE CODE FOR : SetJPasswordFieldBackgroundColor.java
****************************************************************************


import javax.swing.JPasswordField;
import javax.swing.JFrame;

import java.awt.Color;

public class SetJPasswordFieldBackgroundColor
{
public static void main(String[]args)
{
//Create password field with number of columns equal to 10
JPasswordField passwordField=new JPasswordField(10);

//Create JFrame with title ( Set JPasswordField background color )
JFrame frame=new JFrame("Set JPasswordField background color");

//Set color base on RGB
//You can get RGB value for your color at "Color picker" at above
//R=255
//G=0
//B=0
Color color=new Color(255,0,0);

//Set JPasswordField background color to color that you choose
passwordField.setBackground(color);

//Add JPasswordField into JFrame
frame.add(passwordField);

//Set default close operation for JFrame
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

//Set JFrame size
frame.setSize(500,65);

//Make JFrame visible
frame.setVisible(true);
}
}


****************************************************************************
JUST COMPILE AND EXECUTE IT
****************************************************************************

RELAXING NATURE VIDEO