RadioButton
/* Copy Code */
import javax.swing.*;
import java.awt.*;
public class MyRadioButton {
MyRadioButton(){
JFrame frame=new JFrame("RadioButton");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JRadioButton jrad=new JRadioButton("RadioButton");
jrad.setBounds(300, 50, 110, 50);
jrad.setFocusPainted(false);
Color txtcolor=new Color(0,0,0);
jrad.setForeground(txtcolor);
Color bgcolor=new Color(184,81,81);
jrad.setBackground(bgcolor);
jrad.setFont(new Font("verdana", Font.BOLD, 17));
frame.add(jrad);
frame.setSize(800,600);
frame.setLayout(null);
frame.setVisible(true);
}
public static void main(String[] args) {
new MyRadioButton();
}
}
/* end */
RadioButton
/* Copy Code */
import javax.swing.*;
import java.awt.*;
public class MyRadioButton {
MyRadioButton(){
JFrame frame=new JFrame("RadioButton");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
JRadioButton jrad=new JRadioButton("RadioButton");
jrad.setBounds(300, 50, 110, 50);
jrad.setFocusPainted(false);
Color txtcolor=new Color(0,0,0);
jrad.setForeground(txtcolor);
Color bgcolor=new Color(255,255,255);
jrad.setBackground(bgcolor);
jrad.setFont(new Font("verdana", Font.BOLD, 17));
frame.add(jrad);
frame.setSize(800,600);
frame.setLayout(null);
frame.setVisible(true);
}
public static void main(String[] args) {
new MyRadioButton();
}
}
/* end */