Course Solutions Uncategorized (Solved) : Add Functions Java Gui Program Want Change Color Foreground Background Jcombobox Public Cl Q35532147 . . . .

(Solved) : Add Functions Java Gui Program Want Change Color Foreground Background Jcombobox Public Cl Q35532147 . . . .

 

Can you add some functions to this Java GUI program?

I just want to change color of foreground and background withJComboBox.

public class SettingFormimplements ActionListener {

JComboBox<String> comboBox1, comboBox2;

   public voidsettingButton() {

   JFrame settingFrame = newJFrame(“Setting”);

   JLabel p1 = newJLabel(“Background”);

   p1.setSize(300, 30);

   p1.setBounds(0, 10, 150, 50);

   settingFrame.setLayout(null);

   settingFrame.add(p1);

   JLabel p2 = new JLabel(“KeypadColor”);

   p2.setBounds(0, 70, 150, 50);

   settingFrame.add(p2);

   comboBox1 = newJComboBox<>();

comboBox1.addActionListener(this);

comboBox1.addItem(“Black”);

   comboBox1.addItem(“White”);

comboBox1.addItem(“Blue”);

comboBox1.setBounds(140, 10, 150, 50);

settingFrame.add(comboBox1);

comboBox2 = new JComboBox<>();

comboBox2.addActionListener(this);

comboBox2.addItem(“Black”);

   comboBox2.addItem(“White”);

comboBox2.addItem(“Blue”);

comboBox2.setBounds(140, 70, 150, 50);

settingFrame.add(comboBox2);

   //OK button

   JButton ok = newJButton(“OK”);

   ok.addActionListener(this);

   settingFrame.add(ok);

   ok.setBounds(0, 300, 300, 50);

   settingFrame.setVisible(true);

   settingFrame.pack();

   settingFrame.setSize(300,400);

  settingFrame.setLocationRelativeTo(null);

   }

   publicstatic void main(String[] args){

   SettingForm form = newSettingForm();

   form.settingButton();

   }

   @Override

   public voidactionPerformed(ActionEvent e) {

  System.out.println(“Bottonpressed!!!”);

   }

}

Expert

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

(Solved) : 5 15 Points Sequential Circuit Consists Two D Flip Flops B Circuit Two External Inputs X Q36506100 . . . .(Solved) : 5 15 Points Sequential Circuit Consists Two D Flip Flops B Circuit Two External Inputs X Q36506100 . . . .

<p><img alt="5. (15 points) A sequential circuit consists out of two D flip-flops (A and B). The circuit has two external inputs (X and Y)" src="https://media.cheggcdn.com/media%2Fbf4%2Fbf41aa50-19d1-4a6b-9876-e64444bdf646%2FphpRC0S3D.png" style="height:726px;width:1024px;" aria-describedby="d3f"/></p>5. (15 points)