Question: JAVA CODING HELP. Need help modifying my code below. Add a cardLayout to add 3 panels the user can select from Home, Congratulations Card, and

JAVA CODING HELP. Need help modifying my code below. Add a cardLayout to add 3 panels the user can select from Home, Congratulations Card, and Birthday Card. The application begins on the Home panel which asks for the user to type in the recipients name. The user may select to view a different panel using the Select menu. The Colors menu allows the user to change the color of all panels. The Font menu allows the user to change the font of the customizable display message.

 JAVA CODING HELP. Need help modifying my code below. Add a

HERE IS MY CODE COPY AND PASTE INTO A COMPILER AND EDIT TO TO MATCH THE PICTURES SHOWN ABOVE

package demo;

import javax.swing.*;

import java.awt.*;

import java.awt.event.*;

import java.awt.Color;

public class JKeyDemo extends JFrame implements

ActionListener {

private JMenuBar mainBar = new JMenuBar();

private JMenu menu1 = new JMenu("File");

private JMenu menu2 = new JMenu("Colors");

private JMenuItem exit = new JMenuItem("Exit");

private JMenu bright = new JMenu("Bright");

private JMenuItem dark = new JMenuItem("Dark");

private JMenuItem white = new JMenuItem("White");

private JMenuItem pink = new JMenuItem("Pink");

private JMenuItem yellow = new JMenuItem("Yellow");

private JLabel label = new JLabel("Hello");

public JKeyDemo() {

setLayout(new FlowLayout());

setJMenuBar(mainBar);

mainBar.add(menu1);

mainBar.add(menu2);

menu1.add(exit);

menu2.add(bright);

menu2.add(dark);

menu2.add(white);

bright.add(pink);

bright.add(yellow);

exit.addActionListener(this);

dark.addActionListener(this);

white.addActionListener(this);

pink.addActionListener(this);

yellow.addActionListener(this);

add(label);

label.setFont(new Font("Arial", Font.BOLD, 26)); }

@Override

public void actionPerformed(ActionEvent e) {

Object source = e.getSource();

Container con = getContentPane();

if(source == exit) System.exit(0);

else if(source == dark)

con.setBackground(Color.BLACK);

else if(source == white)

con.setBackground(Color.WHITE);

else if(source == pink)

con.setBackground(Color.PINK);

else con.setBackground(Color.YELLOW);

}

public static void main(String[] args) {

JKeyDemo mFrame = new JKeyDemo();

final int WIDTH = 250;

final int HEIGHT = 200;

mFrame.setSize(WIDTH, HEIGHT);

mFrame.setVisible(true);

}

}

Card Designer Application igner Application Please Enter The Recipient's NameTmmy Congratalatioes Tim Happt Birthday Ty Note the additional Color Options Hhday Timmy Happ If the user navigates back to the home page the previously entered name remains in the texd field Card Designer Application Tinvny Then Get Started By Making Selections Feom the Men

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!