Put JRadioButton into group

Complete source code below will show you, how to create group for JRadioButton.

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


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

import java.awt.GridLayout;

public class PutJRadioButtonIntoGroup
{
public static void main(String[]args)
{
//Create five radio button that will be put into a group
JRadioButton firstRadioButton=new JRadioButton("First radio button");
JRadioButton secondRadioButton=new JRadioButton("Second radio button");
JRadioButton thirdRadioButton=new JRadioButton("Third radio button");
JRadioButton fourthRadioButton=new JRadioButton("Fourth radio button");
JRadioButton fifthRadioButton=new JRadioButton("Fifth radio button");

//Create a button group using ButtonGroup
ButtonGroup bg=new ButtonGroup();

//Add all radio button into created group
bg.add(firstRadioButton);
bg.add(secondRadioButton);
bg.add(thirdRadioButton);
bg.add(fourthRadioButton);
bg.add(fifthRadioButton);

//Create a window using JFrame with title ( Put JRadioButton into group )
JFrame frame=new JFrame("Put JRadioButton into group");

//Set JFrame layout to grid layout
frame.setLayout(new GridLayout(5,1));

//Add all created button into group
frame.add(firstRadioButton);
frame.add(secondRadioButton);
frame.add(thirdRadioButton);
frame.add(fourthRadioButton);
frame.add(fifthRadioButton);

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

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

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


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

JRadioButton not select at start

Complete source code below will show you, how to make JRadioButton not select at start.

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


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

import java.awt.FlowLayout;

public class RadioButtonNotSelectAtStart
{
public static void main(String[]args)
{
//Create radio button with not select at start
//You can make this radio button select on start by change false to true
JRadioButton radioButton=new JRadioButton("I am a radio button",false);

//Create a window using JFrame with title ( JRadioButton not select on start )
JFrame frame=new JFrame("JRadioButton not select on start");

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

//add created radio button into JFrame
frame.add(radioButton);

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

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

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


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

JRadioButton select at start

Complete source code below will show you, how to make JRadioButton select at start.

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


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

import java.awt.FlowLayout;

public class RadioButtonSelectAtStart
{
public static void main(String[]args)
{
//Create radio button with select at start
//You can make this radio button not select on start by change true to false
JRadioButton radioButton=new JRadioButton("I am a radio button",true);


//Create a window using JFrame with title ( JRadioButton select on start )
JFrame frame=new JFrame("JRadioButton select on start");

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

//add created radio button into JFrame
frame.add(radioButton);

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

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

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


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

Set JPasswordField text color

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

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


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

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

public class SetJPasswordFieldTextColor
{
public static void main(String[]args)
{
//Create password field using JPasswordField
JPasswordField passwordField=new JPasswordField(10);

//Create JFrame with title ( Set JPasswordField text color )
JFrame frame=new JFrame("Set JPasswordField 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 JPasswordField text 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,300);

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


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

Set JPasswordField text center

Complete source code below will show you, how to make text in JPasswordField start at center.

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


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

import javax.swing.SwingConstants;

public class SetJPasswordFieldContentsToCenter
{
public static void main(String[]args)
{
JPasswordField passwordField=new JPasswordField(10);

//Make contents in JPasswordField start at center
passwordField.setHorizontalAlignment(SwingConstants.CENTER);

JFrame frame=new JFrame("Set JPasswordField contents to center");
frame.add(passwordField);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(400,65);
frame.setVisible(true);
}
}


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

Set JTextField text center

Source code below will show you, how to make text in JTextField start at center.

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


import javax.swing.JTextField;
import javax.swing.JFrame;

import javax.swing.SwingConstants;

public class SetJTextFieldTextToCenter
{
public static void main(String[]args)
{
JTextField textField=new JTextField(10);

//Make text in JTextField start at center
textField.setHorizontalAlignment(SwingConstants.CENTER);

JFrame frame=new JFrame("Set JTextField text to center");
frame.add(textField);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(400,65);
frame.setVisible(true);
}
}


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

Tool tip text

Tool tip text is a description about a component. For example, about a button in a graphical user interface. A tool tip text will appear when you hover and stop for certain time on the button.

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


import javax.swing.JFrame;
import javax.swing.JButton;

public class ToolTipText
{
public static void main(String[]args)
{
//Create a button with text ( Hover on me and don't move )
JButton button=new JButton("Hover on me and don't move");

//SET TOOL TIP TEXT TO THE BUTTON
//Text : I am tool tip text
button.setToolTipText("I am tool tip text");

//Create a JFrame with title ( Tool tip text )
JFrame frame=new JFrame("Tool tip text");

//Add created button into JFrame
frame.add(button);

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

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

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


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

Set JRadioButton text bold and italic

Source code below will show you, how to set JRadioButton text to bold and italic.

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


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

import java.awt.BorderLayout;
import java.awt.Font;

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

//Create font.
//Font Name : Default radio button font
//Font Style : Bold And Italic
//Font Size : Default radio button font size
Font newRadioButtonFont=new Font(radioButton.getFont().getName(),Font.ITALIC+Font.BOLD,radioButton.getFont().getSize());

//Set JRadioButton font using new created font
radioButton.setFont(newRadioButtonFont);

//Create a window using JFrame with title ( Set JRadioButton text bold and italic )
JFrame frame=new JFrame("Set JRadioButton text bold and italic");

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

//Add created radio button into JFrame
frame.add(radioButton);

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

//Set JFrame size
frame.setSize(400,200);

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


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

Set JRadioButton text italic

Source code below will show you, how to set JRadioButton text to italic.

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


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

import java.awt.BorderLayout;
import java.awt.Font;

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

//Create font.
//Font Name : Default radio button font
//Font Style : Italic
//Font Size : Default radio button font size
Font newRadioButtonFont=new Font(radioButton.getFont().getName(),Font.ITALIC,radioButton.getFont().getSize());

//Set JRadioButton font using new created font
radioButton.setFont(newRadioButtonFont);

//Create a window using JFrame with title ( Set JRadioButton text italic )
JFrame frame=new JFrame("Set JRadioButton text italic");

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

//Add created radio button into JFrame
frame.add(radioButton);

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

//Set JFrame size
frame.setSize(400,200);

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


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

Set JRadioButton text bold

Source code below will show you, how to set JRadioButton text to bold.

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


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

import java.awt.BorderLayout;
import java.awt.Font;

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

//Create font.
//Font Name : Default radio button font
//Font Style : Bold
//Font Size : Default radio button font size
Font newRadioButtonFont=new Font(radioButton.getFont().getName(),Font.BOLD,radioButton.getFont().getSize());

//Set JRadioButton font using new created font
radioButton.setFont(newRadioButtonFont);

//Create a window using JFrame with title ( Set JRadioButton text bold )
JFrame frame=new JFrame("Set JRadioButton text bold");

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

//Add created radio button into JFrame
frame.add(radioButton);

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

//Set JFrame size
frame.setSize(400,200);

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


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

Set JRadioButton text size

Source code below will show you, how to set JRadioButton text size.

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


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

import java.awt.BorderLayout;
import java.awt.Font;

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

//Create font.
//Font Name : Default radio button font
//Font Style : Default radio button font style
//Font Size : 22
Font newRadioButtonFont=new Font(radioButton.getFont().getName(),radioButton.getFont().getStyle(),22);

//Set JRadioButton font using new created font
radioButton.setFont(newRadioButtonFont);

//Create a window using JFrame with title ( Set JRadioButton text size )
JFrame frame=new JFrame("Set JRadioButton text size");

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

//Add created radio button into JFrame
frame.add(radioButton);

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

//Set JFrame size
frame.setSize(400,200);

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


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

Set JRadioButton text font

Source code below will show you, how to set JRadioButton text font.

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


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

import java.awt.BorderLayout;
import java.awt.Font;

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

//Create font.
//Font Name : Tahoma
//Font Style : Default radio button font style
//Font Size : Default radio button font size
Font newRadioButtonFont=new Font("Tahoma",radioButton.getFont().getStyle(),radioButton.getFont().getSize());

//Set JRadioButton font using new created font
radioButton.setFont(newRadioButtonFont);

//Create a window using JFrame with title ( Set JRadioButton text font )
JFrame frame=new JFrame("Set JRadioButton text font");

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

//Add created radio button into JFrame
frame.add(radioButton);

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

//Set JFrame size
frame.setSize(400,200);

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


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

Set JCheckBox text bold and italic

Source code below will show you, how to set JCheckBox text to bold and italic.

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


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

import java.awt.BorderLayout;
import java.awt.Font;

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

//Create font.
//Font Name : Default check box font
//Font Style : Bold And Italic
//Font Size : Default check box font size
Font newCheckBoxFont=new Font(checkBox.getFont().getName(),Font.ITALIC+Font.BOLD,checkBox.getFont().getSize());

//Set JCheckBox font using new created font
checkBox.setFont(newCheckBoxFont);

//Create a window using JFrame with title ( Set JCheckBox text bold and italic )
JFrame frame=new JFrame("Set JCheckBox text bold and italic");

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

//Add created check box into JFrame
frame.add(checkBox);

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

//Set JFrame size
frame.setSize(400,200);

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


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

Set JCheckBox text italic

Source code below will show you, how to set JCheckBox text to italic.

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


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

import java.awt.BorderLayout;
import java.awt.Font;

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

//Create font.
//Font Name : Default check box font
//Font Style : Italic
//Font Size : Default check box font size
Font newCheckBoxFont=new Font(checkBox.getFont().getName(),Font.ITALIC,checkBox.getFont().getSize());

//Set JCheckBox font using new created font
checkBox.setFont(newCheckBoxFont);

//Create a window using JFrame with title ( Set JCheckBox text italic )
JFrame frame=new JFrame("Set JCheckBox text italic");

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

//Add created check box into JFrame
frame.add(checkBox);

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

//Set JFrame size
frame.setSize(400,200);

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


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

Set JCheckBox text bold

Source code below will show you, how to set JCheckBox text to bold.

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


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

import java.awt.BorderLayout;
import java.awt.Font;

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

//Create font.
//Font Name : Default check box font
//Font Style : Bold
//Font Size : Default check box font size
Font newCheckBoxFont=new Font(checkBox.getFont().getName(),Font.BOLD,checkBox.getFont().getSize());

//Set JCheckBox font using new created font
checkBox.setFont(newCheckBoxFont);

//Create a window using JFrame with title ( Set JCheckBox text bold )
JFrame frame=new JFrame("Set JCheckBox text bold");

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

//Add created check box into JFrame
frame.add(checkBox);

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

//Set JFrame size
frame.setSize(400,200);

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


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

Set JCheckBox text size

Source code below will show you, how to set JCheckBox text size.

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


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

import java.awt.BorderLayout;
import java.awt.Font;

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

//Create font.
//Font Name : Default check box font
//Font Style : Default check box font style
//Font Size : 22
Font newCheckBoxFont=new Font(checkBox.getFont().getName(),checkBox.getFont().getStyle(),22);

//Set JCheckBox font using new created font
checkBox.setFont(newCheckBoxFont);

//Create a window using JFrame with title ( Set JCheckBox text size )
JFrame frame=new JFrame("Set JCheckBox text size");

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

//Add created check box into JFrame
frame.add(checkBox);

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

//Set JFrame size
frame.setSize(400,200);

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


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

Set JCheckBox text font

Source code below will show you, how to set JCheckBox text font.

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


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

import java.awt.BorderLayout;
import java.awt.Font;

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

//Create font.
//Font Name : Tahoma
//Font Style : Default check box font style
//Font Size : Default check box font size
Font newCheckBoxFont=new Font("Tahoma",checkBox.getFont().getStyle(),checkBox.getFont().getSize());

//Set JCheckBox font using new created font
checkBox.setFont(newCheckBoxFont);

//Create a window using JFrame with title ( Set JCheckBox text font )
JFrame frame=new JFrame("Set JCheckBox text font");

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

//Add created check box into JFrame
frame.add(checkBox);

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

//Set JFrame size
frame.setSize(400,200);

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


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

Set JLabel text bold and italic

Source code below will show you, how to set JLabel text to bold and italic.

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


import javax.swing.JLabel;
import javax.swing.JFrame;
import javax.swing.SwingConstants;

import java.awt.BorderLayout;
import java.awt.Font;

public class SetJLabelTextBoldAndItalic
{
public static void main(String[]args)
{
//Create label using JLabel with text ( HI EVERYONE !! I love you all )
JLabel label=new JLabel("HI EVERYONE !! I love you all",SwingConstants.CENTER);

//Create font.
//Font Name : Default label font
//Font Style : Bold And Italic
//Font Size : Default label font size
Font newLabelFont=new Font(label.getFont().getName(),Font.ITALIC+Font.BOLD,label.getFont().getSize());

//Set JLabel font using new created font
label.setFont(newLabelFont);

//Create a window using JFrame with title ( Set JLabel text bold and italic )
JFrame frame=new JFrame("Set JLabel text bold and italic");

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

//Add created label into JFrame
frame.add(label);

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

//Set JFrame size
frame.setSize(400,200);

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


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

Set JLabel text italic

Source code below will show you, how to set JLabel text to italic.

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


import javax.swing.JLabel;
import javax.swing.JFrame;
import javax.swing.SwingConstants;

import java.awt.BorderLayout;
import java.awt.Font;

public class SetJLabelTextItalic
{
public static void main(String[]args)
{
//Create label using JLabel with text ( HI EVERYONE !! I love you all )
JLabel label=new JLabel("HI EVERYONE !! I love you all",SwingConstants.CENTER);

//Create font.
//Font Name : Default label font
//Font Style : Italic
//Font Size : Default label font size
Font newLabelFont=new Font(label.getFont().getName(),Font.ITALIC,label.getFont().getSize());

//Set JLabel font using new created font
label.setFont(newLabelFont);

//Create a window using JFrame with title ( Set JLabel text italic )
JFrame frame=new JFrame("Set JLabel text italic");

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

//Add created label into JFrame
frame.add(label);

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

//Set JFrame size
frame.setSize(400,200);

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


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

Set JLabel text bold

Source code below will show you, how to set JLabel text to bold.

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


import javax.swing.JLabel;
import javax.swing.JFrame;
import javax.swing.SwingConstants;

import java.awt.BorderLayout;
import java.awt.Font;

public class SetJLabelTextBold
{
public static void main(String[]args)
{
//Create label using JLabel with text ( HI EVERYONE !! I love you all )
JLabel label=new JLabel("HI EVERYONE !! I love you all",SwingConstants.CENTER);

//Create font.
//Font Name : Default label font
//Font Style : Bold
//Font Size : Default label font size
Font newLabelFont=new Font(label.getFont().getName(),Font.BOLD,label.getFont().getSize());

//Set JLabel font using new created font
label.setFont(newLabelFont);

//Create a window using JFrame with title ( Set JLabel text bold )
JFrame frame=new JFrame("Set JLabel text bold");

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

//Add created label into JFrame
frame.add(label);

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

//Set JFrame size
frame.setSize(400,200);

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


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

Set JLabel text size

Source code below will show you, how to set JLabel text size.

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


import javax.swing.JLabel;
import javax.swing.JFrame;
import javax.swing.SwingConstants;

import java.awt.BorderLayout;
import java.awt.Font;

public class SetJLabelTextSize
{
public static void main(String[]args)
{
//Create label using JLabel with text ( HI EVERYONE !! I love you all )
JLabel label=new JLabel("HI EVERYONE !! I love you all",SwingConstants.CENTER);

//Create font.
//Font Name : Default label font
//Font Style : Default label font style
//Font Size : 22
Font newLabelFont=new Font(label.getFont().getName(),label.getFont().getStyle(),22);

//Set JLabel font using new created font
label.setFont(newLabelFont);

//Create a window using JFrame with title ( Set JLabel text size )
JFrame frame=new JFrame("Set JLabel text size");

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

//Add created label into JFrame
frame.add(label);

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

//Set JFrame size
frame.setSize(400,200);

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


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

Set JLabel text font

Source code below will show you, how to set JLabel text font.

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


import javax.swing.JLabel;
import javax.swing.JFrame;
import javax.swing.SwingConstants;

import java.awt.BorderLayout;
import java.awt.Font;

public class SetJLabelTextFont
{
public static void main(String[]args)
{
//Create label using JLabel with text ( HI EVERYONE !! I love you all )
JLabel label=new JLabel("HI EVERYONE !! I love you all",SwingConstants.CENTER);

//Create font.
//Font Name : Tahoma
//Font Style : Default label font style
//Font Size : Default label font size
Font newLabelFont=new Font("Tahoma",label.getFont().getStyle(),label.getFont().getSize());

//Set JLabel font using new created font
label.setFont(newLabelFont);

//Create a window using JFrame with title ( Set JLabel text font )
JFrame frame=new JFrame("Set JLabel text font");

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

//Add created label into JFrame
frame.add(label);

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

//Set JFrame size
frame.setSize(400,200);

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


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

Set JTextArea text bold and italic

Source code below will show you, how to set JTextArea text to bold and italic.

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


import javax.swing.JTextArea;
import javax.swing.JFrame;

import java.awt.BorderLayout;
import java.awt.Font;

public class SetJTextAreaTextBoldAndItalic
{
public static void main(String[]args)
{
//Create text area using JTextArea
JTextArea textArea=new JTextArea();

//Set line wrap to true
textArea.setLineWrap(true);

//Create font.
//Font Name : Default text area font
//Font Style : Bold And Italic
//Font Size : Default text area font size
Font newTextAreaFont=new Font(textArea.getFont().getName(),Font.ITALIC+Font.BOLD,textArea.getFont().getSize());

//Set JTextArea font using new created font
textArea.setFont(newTextAreaFont);

//Create a window using JFrame with title ( Set JTextArea text bold and italic )
JFrame frame=new JFrame("Set JTextArea text bold and italic");

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

//Add created text area into JFrame
frame.add(textArea);

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

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

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


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

Set JTextArea text italic

Source code below will show you, how to set JTextArea text to italic.

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


import javax.swing.JTextArea;
import javax.swing.JFrame;

import java.awt.BorderLayout;
import java.awt.Font;

public class SetJTextAreaTextItalic
{
public static void main(String[]args)
{
//Create text area using JTextArea
JTextArea textArea=new JTextArea();

//Set line wrap to true
textArea.setLineWrap(true);

//Create font.
//Font Name : Default text area font
//Font Style : Italic
//Font Size : Default text area font size
Font newTextAreaFont=new Font(textArea.getFont().getName(),Font.ITALIC,textArea.getFont().getSize());

//Set JTextArea font using new created font
textArea.setFont(newTextAreaFont);

//Create a window using JFrame with title ( Set JTextArea text italic )
JFrame frame=new JFrame("Set JTextArea text italic");

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

//Add created text area into JFrame
frame.add(textArea);

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

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

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


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

Set JTextArea text bold

Source code below will show you, how to set JTextArea text to bold.

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


import javax.swing.JTextArea;
import javax.swing.JFrame;

import java.awt.BorderLayout;
import java.awt.Font;

public class SetJTextAreaTextBold
{
public static void main(String[]args)
{
//Create text area using JTextArea
JTextArea textArea=new JTextArea();

//Set line wrap to true
textArea.setLineWrap(true);

//Create font.
//Font Name : Default text area font
//Font Style : Bold
//Font Size : Default text area font size
Font newTextAreaFont=new Font(textArea.getFont().getName(),Font.BOLD,textArea.getFont().getSize());

//Set JTextArea font using new created font
textArea.setFont(newTextAreaFont);

//Create a window using JFrame with title ( Set JTextArea text bold )
JFrame frame=new JFrame("Set JTextArea text bold");

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

//Add created text area into JFrame
frame.add(textArea);

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

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

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


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

Set JTextArea text size

Source code below will show you, how to set JTextArea text size.

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


import javax.swing.JTextArea;
import javax.swing.JFrame;

import java.awt.BorderLayout;
import java.awt.Font;

public class SetJTextAreaTextSize
{
public static void main(String[]args)
{
//Create text area using JTextArea
JTextArea textArea=new JTextArea();

//Set line wrap to true
textArea.setLineWrap(true);

//Create font.
//Font Name : Default text area font
//Font Style : Default text area font style
//Font Size : 22
Font newTextAreaFont=new Font(textArea.getFont().getName(),textArea.getFont().getStyle(),22);

//Set JTextArea font using new created font
textArea.setFont(newTextAreaFont);

//Create a window using JFrame with title ( Set JTextArea text size )
JFrame frame=new JFrame("Set JTextArea text size");

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

//Add created text area into JFrame
frame.add(textArea);

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

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

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


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

Set JTextArea text font

Source code below will show you, how to set JTextArea text font.

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


import javax.swing.JTextArea;
import javax.swing.JFrame;

import java.awt.BorderLayout;
import java.awt.Font;

public class SetJTextAreaTextFont
{
public static void main(String[]args)
{
//Create text area using JTextArea
JTextArea textArea=new JTextArea();

//Set line wrap to true
textArea.setLineWrap(true);

//Create font.
//Font Name : Tahoma
//Font Style : Default text area font style
//Font Size : Default text area font size
Font newTextAreaFont=new Font("Tahoma",textArea.getFont().getStyle(),textArea.getFont().getSize());

//Set JTextArea font using new created font
textArea.setFont(newTextAreaFont);

//Create a window using JFrame with title ( Set JTextArea text font )
JFrame frame=new JFrame("Set JTextArea text font");

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

//Add created text area into JFrame
frame.add(textArea);

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

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

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


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

Set JButton text bold and italic

Source code below will show you, how to set JButton text to bold and italic.

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


import javax.swing.JButton;
import javax.swing.JFrame;

import java.awt.FlowLayout;
import java.awt.Font;

public class SetJButtonTextBoldAndItalic
{
public static void main(String[]args)
{
//Create button with text ( MY BUTTON )
JButton button=new JButton("MY BUTTON");

//Create font.
//Font Name : Default button font
//Font Style : Bold And Italic
//Font Size : Default button font size
Font newButtonFont=new Font(button.getFont().getName(),Font.ITALIC+Font.BOLD,button.getFont().getSize());

//Set JButton font using new created font
button.setFont(newButtonFont);

//Create a window using JFrame with title ( Set JButton text bold and italic )
JFrame frame=new JFrame("Set JButton text bold and italic");

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

//Add created button into JFrame
frame.add(button);

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

//Set JFrame size
frame.setSize(400,100);

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


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

Set JTextField text bold and italic

Source code below will show you, how to set JTextField text to bold and italic.

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


import javax.swing.JTextField;
import javax.swing.JFrame;

import java.awt.FlowLayout;
import java.awt.Font;

public class SetJTextFieldTextBoldAndItalic
{
public static void main(String[]args)
{
//Create text field using JTextField
JTextField textField=new JTextField(20);

//Create font.
//Font Name : Default text field font
//Font Style : Bold And Italic
//Font Size : Default text field font size
Font newTextFieldFont=new Font(textField.getFont().getName(),Font.ITALIC+Font.BOLD,textField.getFont().getSize());

//Set JTextField font using new created font
textField.setFont(newTextFieldFont);

//Create a window using JFrame with title ( Set JTextField text bold and italic )
JFrame frame=new JFrame("Set JTextField text bold and italic");

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

//Add created text field into JFrame
frame.add(textField);

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

//Set JFrame size
frame.setSize(400,100);

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


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

Set JTextField text italic

Source code below will show you, how to set JTextField text to italic.

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


import javax.swing.JTextField;
import javax.swing.JFrame;

import java.awt.FlowLayout;
import java.awt.Font;

public class SetJTextFieldTextItalic
{
public static void main(String[]args)
{
//Create text field using JTextField
JTextField textField=new JTextField(20);

//Create font.
//Font Name : Default text field font
//Font Style : Italic
//Font Size : Default text field font size
Font newTextFieldFont=new Font(textField.getFont().getName(),Font.ITALIC,textField.getFont().getSize());

//Set JTextField font using new created font
textField.setFont(newTextFieldFont);

//Create a window using JFrame with title ( Set JTextField text italic )
JFrame frame=new JFrame("Set JTextField text italic");

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

//Add created text field into JFrame
frame.add(textField);

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

//Set JFrame size
frame.setSize(400,100);

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


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

Set JTextField text bold

Source code below will show you, how to set JTextField text to bold.

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


import javax.swing.JTextField;
import javax.swing.JFrame;

import java.awt.FlowLayout;
import java.awt.Font;

public class SetJTextFieldTextBold
{
public static void main(String[]args)
{
//Create text field using JTextField
JTextField textField=new JTextField(20);

//Create font.
//Font Name : Default text field font
//Font Style : Bold
//Font Size : Default text field font size
Font newTextFieldFont=new Font(textField.getFont().getName(),Font.BOLD,textField.getFont().getSize());

//Set JTextField font using new created font
textField.setFont(newTextFieldFont);

//Create a window using JFrame with title ( Set JTextField text bold )
JFrame frame=new JFrame("Set JTextField text bold");

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

//Add created text field into JFrame
frame.add(textField);

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

//Set JFrame size
frame.setSize(400,100);

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


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

Set JTextField text size

Source code below will show you, how to set JTextField text size.

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


import javax.swing.JTextField;
import javax.swing.JFrame;

import java.awt.FlowLayout;
import java.awt.Font;

public class SetJTextFieldTextSize
{
public static void main(String[]args)
{
//Create text field using JTextField
JTextField textField=new JTextField(20);

//Create font.
//Font Name : Default text field font
//Font Style : Default text field font style
//Font Size : 16
Font newTextFieldFont=new Font(textField.getFont().getName(),textField.getFont().getStyle(),16);

//Set JTextField font using new created font
textField.setFont(newTextFieldFont);

//Create a window using JFrame with title ( Set JTextField text size )
JFrame frame=new JFrame("Set JTextField text size");

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

//Add created text field into JFrame
frame.add(textField);

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

//Set JFrame size
frame.setSize(400,100);

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


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

Set JTextField text font

Source code below will show you, how to set JTextField text font.

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


import javax.swing.JTextField;
import javax.swing.JFrame;

import java.awt.FlowLayout;
import java.awt.Font;

public class SetJTextFieldTextFont
{
public static void main(String[]args)
{
//Create text field using JTextField
JTextField textField=new JTextField(20);

//Create font.
//Font Name : Tahoma
//Font Style : Default text field font style
//Font Size : Default text field font size
Font newTextFieldFont=new Font("Tahoma",textField.getFont().getStyle(),textField.getFont().getSize());

//Set JTextField font using new created font
textField.setFont(newTextFieldFont);

//Create a window using JFrame with title ( Set JTextField text font )
JFrame frame=new JFrame("Set JTextField text font");

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

//Add created text field into JFrame
frame.add(textField);

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

//Set JFrame size
frame.setSize(400,100);

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


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

Set JButton text italic

Source code below will show you, how to set JButton text to italic.

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


import javax.swing.JButton;
import javax.swing.JFrame;

import java.awt.FlowLayout;
import java.awt.Font;

public class SetJButtonTextItalic
{
public static void main(String[]args)
{
//Create button with text ( MY BUTTON )
JButton button=new JButton("MY BUTTON");

//Create font.
//Font Name : Default button font
//Font Style : Italic
//Font Size : Default button font size
Font newButtonFont=new Font(button.getFont().getName(),Font.ITALIC,button.getFont().getSize());

//Set JButton font using new created font
button.setFont(newButtonFont);

//Create a window using JFrame with title ( Set JButton text italic )
JFrame frame=new JFrame("Set JButton text italic");

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

//Add created button into JFrame
frame.add(button);

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

//Set JFrame size
frame.setSize(400,100);

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


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

Set JButton text bold

Source code below will show you, how to set JButton text to bold.

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


import javax.swing.JButton;
import javax.swing.JFrame;

import java.awt.FlowLayout;
import java.awt.Font;

public class SetJButtonTextBold
{
public static void main(String[]args)
{
//Create button with text ( MY BUTTON )
JButton button=new JButton("MY BUTTON");

//Create font.
//Font Name : Default button font
//Font Style : Bold
//Font Size : Default button font size
Font newButtonFont=new Font(button.getFont().getName(),Font.BOLD,button.getFont().getSize());

//Set JButton font using new created font
button.setFont(newButtonFont);

//Create a window using JFrame with title ( Set JButton text bold )
JFrame frame=new JFrame("Set JButton text bold");

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

//Add created button into JFrame
frame.add(button);

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

//Set JFrame size
frame.setSize(400,100);

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


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

Set JButton text size

Source code below will show you, how to set JButton text size.

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


import javax.swing.JButton;
import javax.swing.JFrame;

import java.awt.FlowLayout;
import java.awt.Font;

public class SetJButtonTextSize
{
public static void main(String[]args)
{
//Create button with text ( MY BUTTON )
JButton button=new JButton("MY BUTTON");

//Create font.
//Font Name : Default button font
//Font Style : Default button font style
//Font Size : 16
Font newButtonFont=new Font(button.getFont().getName(),button.getFont().getStyle(),16);

//Set JButton font using new created font
button.setFont(newButtonFont);

//Create a window using JFrame with title ( Set JButton text size )
JFrame frame=new JFrame("Set JButton text size");

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

//Add created button into JFrame
frame.add(button);

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

//Set JFrame size
frame.setSize(400,100);

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


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

Set JButton text font

Source code below will show you, how to set JButton text font.

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


import javax.swing.JButton;
import javax.swing.JFrame;

import java.awt.FlowLayout;
import java.awt.Font;

public class SetJButtonTextFont
{
public static void main(String[]args)
{
//Create button with text ( MY BUTTON )
JButton button=new JButton("MY BUTTON");

//Create font.
//Font Name : Tahoma
//Font Style : Default button font style
//Font Size : Default button font size
Font newButtonFont=new Font("Tahoma",button.getFont().getStyle(),button.getFont().getSize());

//Set JButton font using new created font
button.setFont(newButtonFont);

//Create a window using JFrame with title ( Set JButton text font )
JFrame frame=new JFrame("Set JButton text font");

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

//Add created button into JFrame
frame.add(button);

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

//Set JFrame size
frame.setSize(400,100);

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


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

Get JRadioButton text

Source code below will show you how to get text from JRadioButton.

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


import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JRadioButton;

import java.awt.BorderLayout;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class GetJRadioButtonText implements ActionListener
{
//Create button with text ( Click me to get JRadioButton text )
JButton button=new JButton("Click me to get JRadioButton text");

//Create JRadioButton with text ( I am a radio button )
JRadioButton radioButton=new JRadioButton("I am a radio button");

//Create a window with title ( Get JRadioButton text )
JFrame frame=new JFrame("Get JRadioButton text");

public GetJRadioButtonText()
{
//Add action listener to button
button.addActionListener(this);

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

//Add created radio button into JFrame
frame.add(radioButton,BorderLayout.CENTER);

//Add created button into JFrame
frame.add(button,BorderLayout.SOUTH);

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

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

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

public void actionPerformed(ActionEvent event)
{
if(event.getSource()==button)
{
//Method getText will get text from radio button
JOptionPane.showMessageDialog(frame,"JRadioButton text is : "+radioButton.getText());
}
}

public static void main(String[]args)
{
GetJRadioButtonText gjbt=new GetJRadioButtonText();
}
}


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

Get JCheckBox text

Source code below will show you how to get text from JCheckBox.

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


import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JCheckBox;

import java.awt.BorderLayout;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class GetJCheckBoxText implements ActionListener
{
//Create button with text ( Click me to get JCheckBox text )
JButton button=new JButton("Click me to get JCheckBox text");

//Create JCheckBox with text ( I am a checkbox )
JCheckBox checkBox=new JCheckBox("I am a checkbox");

//Create a window with title ( Get JCheckBox text )
JFrame frame=new JFrame("Get JCheckBox text");

public GetJCheckBoxText()
{
//Add action listener to button
button.addActionListener(this);

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

//Add created check box into JFrame
frame.add(checkBox,BorderLayout.CENTER);

//Add created button into JFrame
frame.add(button,BorderLayout.SOUTH);

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

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

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

public void actionPerformed(ActionEvent event)
{
if(event.getSource()==button)
{
//Method getText will get text from check box
JOptionPane.showMessageDialog(frame,"JCheckBox text is : "+checkBox.getText());
}
}

public static void main(String[]args)
{
GetJCheckBoxText gjbt=new GetJCheckBoxText();
}
}


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

Get JLabel text

Source code below will show you how to get text from JLabel.

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


import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JLabel;

import java.awt.BorderLayout;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class GetJLabelText implements ActionListener
{
//Create button with text ( Click me to get JLabel text )
JButton button=new JButton("Click me to get JLabel text");

//Create JLabel with text ( I LOVE YOU )
JLabel label=new JLabel("I LOVE YOU");

//Create a window with title ( Get JLabel text )
JFrame frame=new JFrame("Get JLabel text");

public GetJLabelText()
{
//Add action listener to button
button.addActionListener(this);

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

//Add created label into JFrame
frame.add(label,BorderLayout.CENTER);

//Add created button into JFrame
frame.add(button,BorderLayout.SOUTH);

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

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

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

public void actionPerformed(ActionEvent event)
{
if(event.getSource()==button)
{
//Method getText will get text from label
JOptionPane.showMessageDialog(frame,"JLabel text is : "+label.getText());
}
}

public static void main(String[]args)
{
GetJLabelText gjbt=new GetJLabelText();
}
}


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

Get JTextArea text

Source code below will show you how to get text from JTextArea.

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


import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JTextArea;

import java.awt.BorderLayout;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class GetJTextAreaText implements ActionListener
{
//Create button with text ( Click me to get JTextArea contents )
JButton button=new JButton("Click me to get JTextArea contents");

//Create JTextArea
JTextArea textArea=new JTextArea();

//Create a window with title ( Get JTextArea text )
JFrame frame=new JFrame("Get JTextArea text");

public GetJTextAreaText()
{
//Set line wrapping for text area to true
textArea.setLineWrap(true);

//Add action listener to button
button.addActionListener(this);

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

//Add created text area into JFrame
frame.add(textArea,BorderLayout.CENTER);

//Add created button into JFrame
frame.add(button,BorderLayout.SOUTH);

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

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

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

public void actionPerformed(ActionEvent event)
{
if(event.getSource()==button)
{
//Method getText will get text from text area
JOptionPane.showMessageDialog(frame,"JTextArea text is : "+textArea.getText());
}
}

public static void main(String[]args)
{
GetJTextAreaText gjbt=new GetJTextAreaText();
}
}


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

Get JTextField text

Source code below will show you how to get text from JTextField.

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


import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import javax.swing.JTextField;

import java.awt.GridLayout;

import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class GetJTextFieldText implements ActionListener
{
//Create button with text ( Click me to get JTextField contents )
JButton button=new JButton("Click me to get JTextField contents");

//Create JTextField
JTextField textField=new JTextField(10);

//Create a window with title ( Get JTextField text )
JFrame frame=new JFrame("Get JTextField text");

public GetJTextFieldText()
{
//Add action listener to button
button.addActionListener(this);

//Set JFrame layout to GridLayout
frame.setLayout(new GridLayout(2,1));

//Add created text field into JFrame
frame.add(textField);

//Add created button into JFrame
frame.add(button);

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

//Set JFrame size
frame.setSize(400,100);

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

public void actionPerformed(ActionEvent event)
{
if(event.getSource()==button)
{
//Method getText will get text from text field
JOptionPane.showMessageDialog(frame,"JTextField text is : "+textField.getText());
}
}

public static void main(String[]args)
{
GetJTextFieldText gjbt=new GetJTextFieldText();
}
}


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

Get JButton text

Source code below will show you how to get text from JButton.

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


import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JOptionPane;

import java.awt.FlowLayout;

public class GetJButtonText
{
public static void main(String[]args)
{
//Create a button with text ( Click me )
JButton button=new JButton("Click me");

JFrame frame=new JFrame("Get JButton text");
frame.setLayout(new FlowLayout());
frame.add(button);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(300,300);
frame.setVisible(true);

//Method getText() will get text from JButton
JOptionPane.showMessageDialog(frame,"JButton text is : "+button.getText());
}
}


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

JSlider label

Source code below will show you, how to set major and minor tick for a JSlider and make the label visible on JSlider.

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


import javax.swing.JSlider;
import javax.swing.JFrame;

import java.awt.FlowLayout;

public class JSliderLabel
{
public static void main(String[]args)
{
//Create a slider using JSlider
//Maximum value = 100
//Minimum value = 0
//Initial value = 50
JSlider slider=new JSlider();

//Set minor tick spacing to 1
slider.setMinorTickSpacing(1);

//Set major tick spacing to 10
slider.setMajorTickSpacing(10);

//Enable label on JSlider
slider.setPaintLabels(true);

//Create a window using JFrame with title ( JSlider label )
JFrame frame=new JFrame("JSlider label");

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

//Add created slider into JFrame
frame.add(slider);

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

//Set JFrame size to :
//WIDTH : 400 pixels
//HEIGHT : 200 pixels
frame.setSize(400,200);

//Make JFrame visible. So, we can see it.
frame.setVisible(true);
}
}


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

JSlider tick

Source code below will show you, how to set major and minor tick for a JSlider and make the tick visible on JSlider.

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


import javax.swing.JSlider;
import javax.swing.JFrame;

import java.awt.FlowLayout;

public class JSliderTick
{
public static void main(String[]args)
{
//Create a slider using JSlider
//Maximum value = 100
//Minimum value = 0
//Initial value = 50
JSlider slider=new JSlider();

//Set minor tick spacing to 1
slider.setMinorTickSpacing(1);

//Set major tick spacing to 10
slider.setMajorTickSpacing(10);

//Enable tick on JSlider
slider.setPaintTicks(true);

//Create a window using JFrame with title ( JSlider tick )
JFrame frame=new JFrame("JSlider tick");

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

//Add created slider into JFrame
frame.add(slider);

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

//Set JFrame size to :
//WIDTH : 400 pixels
//HEIGHT : 200 pixels
frame.setSize(400,200);

//Make JFrame visible. So, we can see it.
frame.setVisible(true);
}
}


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

Create slider using JSlider

Source code below will show you, how to create slider in java using JSlider class.

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


import javax.swing.JSlider;
import javax.swing.JFrame;

import java.awt.FlowLayout;

public class CreateSliderUsingJSlider
{
public static void main(String[]args)
{
//Create a slider using JSlider
JSlider slider=new JSlider();

//Create a window using JFrame with title ( Create slider using JSlider )
JFrame frame=new JFrame("Create slider using JSlider");

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

//Add created slider into JFrame
frame.add(slider);

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

//Set JFrame size to :
//WIDTH : 400 pixels
//HEIGHT : 200 pixels
frame.setSize(400,200);

//Make JFrame visible. So, we can see it.
frame.setVisible(true);
}
}


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

Create slider in java

In java, you can create slider using JSlider class.

Set JPanel background color

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

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


import javax.swing.JPanel;
import javax.swing.JFrame;

import java.awt.Color;

public class SetJPanelBackgroundColor
{
public static void main(String[]args)
{
//Create panel using JPanel
JPanel panel=new JPanel();

//Create JFrame with title ( Set JPanel background color )
JFrame frame=new JFrame("Set JPanel 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 JPanel background color to color that you choose
panel.setBackground(color);

//Add JPanel into JFrame
frame.add(panel);

//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 JButton text color

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

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


import javax.swing.JButton;
import javax.swing.JFrame;

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

public class SetJButtonTextColor
{
public static void main(String[]args)
{
//Create button using JButton
JButton button=new JButton("Click me");

//Create JFrame with title ( Set JButton text color )
JFrame frame=new JFrame("Set JButton 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 JButton text color to color that you choose
button.setForeground(color);

//Add JButton into JFrame
frame.add(button);

//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 JButton background color

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

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


import javax.swing.JButton;
import javax.swing.JFrame;

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

public class SetJButtonBackgroundColor
{
public static void main(String[]args)
{
//Create button using JButton
JButton button=new JButton("Click me");

//Create JFrame with title ( Set JButton background color )
JFrame frame=new JFrame("Set JButton 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 JButton background color to color that you choose
button.setBackground(color);

//Add JButton into JFrame
frame.add(button);

//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 JTextField text color

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

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


import javax.swing.JTextField;
import javax.swing.JFrame;

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

public class SetJTextFieldTextColor
{
public static void main(String[]args)
{
//Create text field using JTextField
JTextField textField=new JTextField(10);

//Create JFrame with title ( Set JTextField text color )
JFrame frame=new JFrame("Set JTextField 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 JTextField text color to color that you choose
textField.setForeground(color);

//Add JTextField into JFrame
frame.add(textField);

//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 JTextField background color

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

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


import javax.swing.JTextField;
import javax.swing.JFrame;

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

public class SetJTextFieldBackgroundColor
{
public static void main(String[]args)
{
//Create text field using JTextField
JTextField textField=new JTextField(10);

//Create JFrame with title ( Set JTextField background color )
JFrame frame=new JFrame("Set JTextField 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 JTextField background color to color that you choose
textField.setBackground(color);

//Add JTextField into JFrame
frame.add(textField);

//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 JTextArea text color

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

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


import javax.swing.JTextArea;
import javax.swing.JFrame;

import java.awt.Color;

public class SetJTextAreaTextColor
{
public static void main(String[]args)
{
//Create text area using JTextArea
JTextArea textArea=new JTextArea();

//Create JFrame with title ( Set JTextArea text color )
JFrame frame=new JFrame("Set JTextArea text 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 JTextArea text color to color that you choose
textArea.setForeground(color);

//Add JTextArea into JFrame
frame.add(textArea);

//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 JTextArea background color

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

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


import javax.swing.JTextArea;
import javax.swing.JFrame;

import java.awt.Color;

public class SetJTextAreaBackgroundColor
{
public static void main(String[]args)
{
//Create text area using JTextArea
JTextArea textArea=new JTextArea();

//Create JFrame with title ( Set JTextArea background color )
JFrame frame=new JFrame("Set JTextArea 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 JTextArea background color to color that you choose
textArea.setBackground(color);

//Add JTextArea into JFrame
frame.add(textArea);

//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 JLabel text color

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

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


import javax.swing.JLabel;
import javax.swing.JFrame;

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

public class SetJLabelTextColor
{
public static void main(String[]args)
{
//Create label with text HI using JLabel
JLabel label=new JLabel("HI");

//Create JFrame with title ( Set JLabel text color )
JFrame frame=new JFrame("Set JLabel 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 JLabel text color to color that you choose
label.setForeground(color);

//Add JLabel into JFrame
frame.add(label);

//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 JLabel background color

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

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


import javax.swing.JLabel;
import javax.swing.JFrame;

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

public class SetJLabelBackgroundColor extends JLabel
{
//Create JFrame with title ( Set JLabel background color )
JFrame frame=new JFrame("Set JLabel 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);

public SetJLabelBackgroundColor()
{
//Set text for JLabel
setText("Set JLabel Background Color");

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

//Add JLabel into JFrame
frame.add(this);

//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);
}

//Fill background color to JLabel
public void paint(Graphics g)
{
g.setColor(color);
g.fillRect(0,0,getWidth(),getHeight());
super.paint(g);
}

public static void main(String[]args)
{
SetJLabelBackgroundColor sjlbc=new SetJLabelBackgroundColor();
}
}


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