Posts

Showing posts from December, 2024

Program-1 Adv jJava

Image
1.Develop a Programe that has only one button in the frame,clicking on the button cycle through the color RED>GREEN>BLUE ans so on.One color change per Click.(Use getBackGround() method to get the current color)  import java.awt.BorderLayout; import java.awt.Color; import java.awt.Container; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.Frame; import java.awt.Panel; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JFrame; public class SimpleAwt extends Frame {     public static void main(String args[]) {         JFrame frame = new JFrame();         JButton button = new JButton("click");         Container c = frame.getContentPane();         c.setBackground(Color.WHITE);         FlowLayout ff = new FlowLayout();         c.setLayout(ff);     ...