Create an application with a JFrame that holds five labels describin.docx

This preview shows page 1 - 4 out of 4 pages.

Create an application with a JFrame that holds five labels describing reasons that a customer might not buy your product (for example, Too expensive ). Every time the user clicks a JButton, remove one of the negative reasons. Save the file as JDemoResistance.java. This is what I have, but it's not working! import javax.swing.*; import java.awt.*; import java.awt.event.*; public class JDemoResistance extends JFrame implements ActionListener { Font firstFont = new Font("Times Roman", Font.ITALIC, 22); JLabel demo = new JLabel("What reasons made you not purchase this item?"); JButton button1 = new JButton("Cost!"); JButton button2 = new JButton("Quality!"); JButton button3 = new JButton("Waranty!"); JButton button4 = new JButton("Features!"); JButton button5 = new JButton("Other!");
public JDemoResistance() { super("Demonstration!"); Container con = getContentPane(); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); demo.setFont(firstFont);

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture