use radio buttons Write a GUI program as shown in the figure
(use radio buttons) Write a GUI program as shown in the figure below. You can use buttons to move the message left and right and use the radiobuttons to change the background color for the message displayed in the message panel.
Solution
//use radio buttons
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.*;
public class UseRadioButtons extends ButtonDemo {
private JRadioButton jrbRed, jrbYellow, jrbWhite, jrbGray, jrbGreen;
public static void main(String[] args) {
UseRadioButtons frame = new UseRadioButtons();
frame.setSize(330, 163);
frame.setLocationRelativeTo(null);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setTitle(