Showing posts with label bold. Show all posts
Showing posts with label bold. Show all posts

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 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 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 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 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 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 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 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 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 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 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
******************************************************************

RELAXING NATURE VIDEO