Results 1 to 5 of 5
  1. #1
    pucketter is offline Member
    Join Date
    Dec 2013
    Posts
    5
    Rep Power
    0

    Question Blank JPanel Issue using an ActionListener

    I need to create a review form when a JButton is clicked to display all the information that was entered/selected. However, when I click the review button, the panel coming up is blank. I did this in another program and it worked but I am stumped this time. I used Windows Builder to create the GUI if things seem out of place. Will clean-up and and add Javadoc later. Would greatly appreciate any tips...or clues as to why this is happening. Oh, I'm also using Eclipse as my compiler.


    import javax.swing.JFrame;
    import javax.swing.JTabbedPane;

    import java.awt.Component;
    import java.awt.GridLayout;

    import javax.swing.AbstractButton;
    import javax.swing.JLabel;
    import javax.swing.ImageIcon;
    import javax.swing.JPanel;
    import java.awt.Color;
    import javax.swing.border.TitledBorder;
    import javax.swing.border.BevelBorder;
    import javax.swing.JTextField;
    import javax.swing.JRadioButton;
    import javax.swing.SwingConstants;
    import java.awt.FlowLayout;
    import javax.swing.JSeparator;
    import java.awt.Font;
    import javax.swing.ButtonGroup;
    import javax.swing.JButton;
    import javax.swing.AbstractAction;
    import java.awt.event.ActionEvent;
    import javax.swing.Action;
    import java.awt.Button;
    import java.awt.event.ActionListener;
    import java.awt.event.KeyAdapter;
    import java.awt.event.KeyEvent;
    import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;

    public class Sandwich extends JFrame {
    private JPanel jpnlStep1;
    private JPanel jpnlStep3;
    private JPanel jpnlStep4;
    private JPanel jpnlStep5;
    private JPanel jpnlStep6;
    private JPanel jpnlStep7;
    private final ButtonGroup sizeButtonGrp = new ButtonGroup();
    private JLabel jlblWelcome;
    private JLabel lblNewLabel;
    private JRadioButton rdbtnGrainBrd;
    private JRadioButton rdbtnItalianBrd;
    private JRadioButton rdbtnItalianHrbBrd;
    private final ButtonGroup buttonGroupBrd = new ButtonGroup();
    private JLabel jlblMeatImage;
    private JLabel jlblCheeseImage;
    private final ButtonGroup buttonGroupCheese = new ButtonGroup();
    private JLabel jlblToppingsImage;
    private final ButtonGroup buttonGroupTop = new ButtonGroup();
    private JLabel jlblExtrasImage;
    private final ButtonGroup buttonGroupExtras = new ButtonGroup();
    private JPanel jpnlStep2;
    private JLabel jlblFirst1;

    public Sandwich() {
    getContentPane().setLayout(new GridLayout(0, 1, 0, 0));

    JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
    getContentPane().add(tabbedPane);

    jpnlStep1 = new JPanel();
    jpnlStep1.setBackground(new Color(255, 255, 255));
    jpnlStep1.setBorder(new TitledBorder(new BevelBorder(
    BevelBorder.LOWERED, new Color(0, 128, 0),
    new Color(0, 128, 0), new Color(255, 255, 0), new Color(255,
    255, 0)), "Name and Sandwich Size",
    TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 128,
    0)));
    tabbedPane.addTab("Step 1", null, jpnlStep1, "Start Your Order Here!");

    JLabel jlblName = new JLabel("First Name");
    jlblName.setForeground(new Color(0, 128, 0));
    jlblName.setBackground(new Color(0, 128, 0));
    jlblName.setFont(new Font("Arial Black", Font.BOLD, 14));

    JRadioButton rdbtnSize6 = new JRadioButton("6 inch Sub: $2.50");
    sizeButtonGrp.add(rdbtnSize6);
    AbstractButton rdbtnSize12 = null;
    sizeButtonGrp.add(rdbtnSize12);
    rdbtnSize6.setBackground(new Color(255, 255, 255));
    rdbtnSize6.setForeground(new Color(0, 128, 0));
    rdbtnSize6.setFont(new Font("Arial", Font.BOLD, 12));

    JRadioButton rdbtnSize121 = new JRadioButton("12 inch sub: $5.00");
    rdbtnSize121.setBackground(new Color(255, 255, 255));
    rdbtnSize121.setForeground(new Color(0, 128, 0));
    rdbtnSize121.setFont(new Font("Arial", Font.BOLD, 12));
    jpnlStep1.setLayout(new FlowLayout(FlowLayout.CENTER, 75, 50));
    jpnlStep1.add(jlblName);

    final JTextField jtxtName = new JTextField();
    jtxtName.setColumns(20);
    jpnlStep1.add(jtxtName);
    jpnlStep1.add(rdbtnSize6);
    jpnlStep1.add(rdbtnSize121);

    jlblWelcome = new JLabel("Welcome to Subway!");
    jlblWelcome.setForeground(new Color(0, 128, 0));
    jlblWelcome.setFont(new Font("Arial Black", Font.BOLD, 18));
    jpnlStep1.add(jlblWelcome);

    Button buttonNext = new Button("Next Page");
    buttonNext.setForeground(new Color(0, 128, 0));
    buttonNext.setFont(new Font("Arial", Font.BOLD, 12));
    jpnlStep1.add(buttonNext);

    jpnlStep2 = new JPanel();
    jpnlStep2.setBorder(new TitledBorder(new BevelBorder(
    BevelBorder.LOWERED, new Color(0, 128, 0),
    new Color(0, 128, 0), new Color(255, 255, 0), new Color(255,
    255, 0)), "Choose Your Bread!", TitledBorder.LEADING,
    TitledBorder.TOP, null, new Color(0, 128, 0)));
    jpnlStep2.setBackground(new Color(255, 255, 255));
    jpnlStep2.setToolTipText("Choose your Bread!");
    tabbedPane.addTab("Step 2", null, jpnlStep2, null);
    jpnlStep2.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 5));

    JRadioButton rdbtnFlatBd = new JRadioButton("Flat Bread");
    rdbtnFlatBd.setBackground(new Color(255, 255, 255));
    rdbtnFlatBd.setForeground(new Color(0, 128, 0));
    rdbtnFlatBd.setFont(new Font("Arial", Font.BOLD, 12));
    jpnlStep2.add(rdbtnFlatBd);

    JRadioButton rdbtnWheatBrd = new JRadioButton("9-Grain Wheat");
    rdbtnWheatBrd.setBackground(new Color(255, 255, 255));
    rdbtnWheatBrd.setForeground(new Color(0, 128, 0));
    rdbtnWheatBrd.setFont(new Font("Arial", Font.BOLD, 12));
    jpnlStep2.add(rdbtnWheatBrd);

    rdbtnGrainBrd = new JRadioButton("9-Grain Honey Oat");
    rdbtnGrainBrd.setBackground(new Color(255, 255, 255));
    rdbtnGrainBrd.setForeground(new Color(0, 128, 0));
    rdbtnGrainBrd.setFont(new Font("Arial", Font.BOLD, 12));
    jpnlStep2.add(rdbtnGrainBrd);

    rdbtnItalianBrd = new JRadioButton("Italian");
    rdbtnItalianBrd.setBackground(new Color(255, 255, 255));
    rdbtnItalianBrd.setForeground(new Color(0, 128, 0));
    rdbtnItalianBrd.setFont(new Font("Arial", Font.BOLD, 12));
    jpnlStep2.add(rdbtnItalianBrd);

    rdbtnItalianHrbBrd = new JRadioButton("Italian Herbs & Cheese");
    rdbtnItalianHrbBrd.setBackground(new Color(255, 255, 255));
    rdbtnItalianHrbBrd.setForeground(new Color(0, 128, 0));
    rdbtnItalianHrbBrd.setFont(new Font("Arial", Font.BOLD, 12));
    jpnlStep2.add(rdbtnItalianHrbBrd);

    buttonGroupBrd.add(rdbtnFlatBd);
    buttonGroupBrd.add(rdbtnItalianHrbBrd);
    buttonGroupBrd.add(rdbtnItalianBrd);
    buttonGroupBrd.add(rdbtnGrainBrd);
    buttonGroupBrd.add(rdbtnWheatBrd);

    jpnlStep3 = new JPanel();
    jpnlStep3.setBorder(new TitledBorder(new BevelBorder(
    BevelBorder.LOWERED, new Color(0, 128, 0),
    new Color(0, 128, 0), new Color(255, 255, 0), new Color(255,
    255, 0)), "Choose Your Meat!", TitledBorder.LEADING,
    TitledBorder.TOP, null, new Color(0, 128, 0)));
    jpnlStep3.setBackground(new Color(255, 255, 255));
    tabbedPane.addTab("Step 3", null, jpnlStep3, "Choose your Meat!");

    JRadioButton rdbtnHam = new JRadioButton("Ham");
    rdbtnHam.setBackground(new Color(255, 255, 255));
    rdbtnHam.setFont(new Font("Arial", Font.BOLD, 12));
    rdbtnHam.setForeground(new Color(0, 128, 0));
    jpnlStep3.add(rdbtnHam);

    JRadioButton rdbtnRoastBf = new JRadioButton("Roast Beef");
    rdbtnRoastBf.setForeground(new Color(0, 128, 0));
    rdbtnRoastBf.setFont(new Font("Arial", Font.BOLD, 12));
    rdbtnRoastBf.setBackground(new Color(255, 255, 255));
    jpnlStep3.add(rdbtnRoastBf);

    JRadioButton rdbtnTurkey = new JRadioButton("Turkey");
    rdbtnTurkey.setForeground(new Color(0, 128, 0));
    rdbtnTurkey.setBackground(new Color(255, 255, 255));
    rdbtnTurkey.setFont(new Font("Arial", Font.BOLD, 12));
    jpnlStep3.add(rdbtnTurkey);

    JRadioButton rdbtnChicken = new JRadioButton("Chicken");
    rdbtnChicken.setForeground(new Color(0, 128, 0));
    rdbtnChicken.setFont(new Font("Arial", Font.BOLD, 12));
    rdbtnChicken.setBackground(new Color(255, 255, 255));
    jpnlStep3.add(rdbtnChicken);

    JRadioButton rdbtnNone = new JRadioButton("None-Cheese Only");
    rdbtnNone.setForeground(new Color(0, 128, 0));
    rdbtnNone.setFont(new Font("Arial", Font.BOLD, 12));
    rdbtnNone.setBackground(new Color(255, 255, 255));
    jpnlStep3.add(rdbtnNone);

    jpnlStep4 = new JPanel();
    jpnlStep4.setBorder(new TitledBorder(new BevelBorder(
    BevelBorder.LOWERED, new Color(0, 128, 0),
    new Color(0, 128, 0), new Color(255, 255, 0), new Color(255,
    255, 0)), "Choose Your Cheese!", TitledBorder.LEADING,
    TitledBorder.TOP, null, new Color(0, 128, 0)));
    jpnlStep4.setBackground(new Color(255, 255, 255));
    tabbedPane.addTab("Step 4", null, jpnlStep4, "Choose your Cheese!");

    JRadioButton rdbtnAmCh = new JRadioButton("American Cheese");
    rdbtnAmCh.setForeground(new Color(0, 128, 0));
    rdbtnAmCh.setFont(new Font("Arial", Font.BOLD, 12));
    rdbtnAmCh.setBackground(new Color(255, 255, 255));
    jpnlStep4.add(rdbtnAmCh);

    JRadioButton rdbtnProvCh = new JRadioButton("Provolone");
    rdbtnProvCh.setForeground(new Color(0, 128, 0));
    rdbtnProvCh.setFont(new Font("Arial", Font.BOLD, 12));
    rdbtnProvCh.setBackground(new Color(255, 255, 255));
    jpnlStep4.add(rdbtnProvCh);

    JRadioButton rdbtnPepJack = new JRadioButton("Pepper Jack");
    rdbtnPepJack.setForeground(new Color(0, 128, 0));
    rdbtnPepJack.setFont(new Font("Arial", Font.BOLD, 12));
    rdbtnPepJack.setBackground(new Color(255, 255, 255));
    jpnlStep4.add(rdbtnPepJack);

    JRadioButton rdbtnMozz = new JRadioButton("Mozzarella");
    rdbtnMozz.setForeground(new Color(0, 128, 0));
    rdbtnMozz.setFont(new Font("Arial", Font.BOLD, 12));
    rdbtnMozz.setBackground(new Color(255, 255, 255));
    jpnlStep4.add(rdbtnMozz);

    JRadioButton rdbtnNoCh = new JRadioButton("No Cheese");
    rdbtnNoCh.setForeground(new Color(0, 128, 0));
    rdbtnNoCh.setFont(new Font("Arial", Font.BOLD, 12));
    rdbtnNoCh.setBackground(new Color(255, 255, 255));
    jpnlStep4.add(rdbtnNoCh);

    buttonGroupCheese.add(rdbtnAmCh);
    buttonGroupCheese.add(rdbtnNoCh);
    buttonGroupCheese.add(rdbtnMozz);
    buttonGroupCheese.add(rdbtnPepJack);
    buttonGroupCheese.add(rdbtnProvCh);

    jpnlStep5 = new JPanel();
    jpnlStep5.setBorder(new TitledBorder(new BevelBorder(
    BevelBorder.LOWERED, new Color(0, 128, 0),
    new Color(0, 128, 0), new Color(255, 255, 0), new Color(255,
    255, 0)), "Choose Your Toppings!",
    TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 128,
    0)));
    jpnlStep5.setBackground(new Color(255, 255, 255));
    tabbedPane.addTab("Step 5", null, jpnlStep5, "Choose your Toppings!");

    JRadioButton rdbtnLettuce = new JRadioButton("Lettuce");
    rdbtnLettuce.setForeground(new Color(0, 128, 0));
    rdbtnLettuce.setFont(new Font("Arial", Font.BOLD, 12));
    rdbtnLettuce.setBackground(new Color(255, 255, 255));
    jpnlStep5.add(rdbtnLettuce);

    JRadioButton rdbtnTom = new JRadioButton("Tomatoes");
    rdbtnTom.setForeground(new Color(0, 128, 0));
    rdbtnTom.setFont(new Font("Arial", Font.BOLD, 12));
    rdbtnTom.setBackground(new Color(255, 255, 255));
    jpnlStep5.add(rdbtnTom);

    JRadioButton rdbtnCucumber = new JRadioButton("Cucumbers");
    rdbtnCucumber.setForeground(new Color(0, 128, 0));
    rdbtnCucumber.setFont(new Font("Arial", Font.BOLD, 12));
    rdbtnCucumber.setBackground(new Color(255, 255, 255));
    jpnlStep5.add(rdbtnCucumber);

    JRadioButton rdbtnPickles = new JRadioButton("Pickles");
    rdbtnPickles.setForeground(new Color(0, 128, 0));
    rdbtnPickles.setFont(new Font("Arial", Font.BOLD, 12));
    rdbtnPickles.setBackground(new Color(255, 255, 255));
    jpnlStep5.add(rdbtnPickles);

    JRadioButton rdbtnPeppers = new JRadioButton("Peppers");
    rdbtnPeppers.setForeground(new Color(0, 128, 0));
    rdbtnPeppers.setFont(new Font("Arial", Font.BOLD, 12));
    rdbtnPeppers.setBackground(new Color(255, 255, 255));
    jpnlStep5.add(rdbtnPeppers);

    JRadioButton rdbtnOlives = new JRadioButton("Olives");
    rdbtnOlives.setForeground(new Color(0, 128, 0));
    rdbtnOlives.setFont(new Font("Arial", Font.BOLD, 12));
    rdbtnOlives.setBackground(new Color(255, 255, 255));
    jpnlStep5.add(rdbtnOlives);

    JRadioButton rdbtnRedOn = new JRadioButton("Red Onions");
    rdbtnRedOn.setForeground(new Color(0, 128, 0));
    rdbtnRedOn.setFont(new Font("Arial", Font.BOLD, 12));
    rdbtnRedOn.setBackground(new Color(255, 255, 255));
    jpnlStep5.add(rdbtnRedOn);

    JRadioButton rdbtnJalapenos = new JRadioButton("Jalapenos");
    rdbtnJalapenos.setForeground(new Color(0, 128, 0));
    rdbtnJalapenos.setFont(new Font("Arial", Font.BOLD, 12));
    rdbtnJalapenos.setBackground(new Color(255, 255, 255));
    jpnlStep5.add(rdbtnJalapenos);

    JRadioButton rdbtnTopNone = new JRadioButton("None");
    rdbtnTopNone.setForeground(new Color(0, 128, 0));
    rdbtnTopNone.setFont(new Font("Arial", Font.BOLD, 12));
    rdbtnTopNone.setBackground(new Color(255, 255, 255));
    jpnlStep5.add(rdbtnTopNone);

    buttonGroupTop.add(rdbtnLettuce);
    buttonGroupTop.add(rdbtnTom);
    buttonGroupTop.add(rdbtnCucumber);
    buttonGroupTop.add(rdbtnPickles);
    buttonGroupTop.add(rdbtnPeppers);
    buttonGroupTop.add(rdbtnOlives);
    buttonGroupTop.add(rdbtnRedOn);
    buttonGroupTop.add(rdbtnJalapenos);
    buttonGroupTop.add(rdbtnTopNone);

    jpnlStep6 = new JPanel();
    jpnlStep6.setBorder(new TitledBorder(new BevelBorder(
    BevelBorder.LOWERED, new Color(0, 128, 0),
    new Color(0, 128, 0), new Color(255, 255, 0), new Color(255,
    255, 0)), "Choose Your Sauce(s)!",
    TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 128,
    0)));
    jpnlStep6.setBackground(new Color(255, 255, 255));
    tabbedPane.addTab("Step 6", null, jpnlStep6, "Choose your Sauces!");

    JRadioButton rdbtnMayo = new JRadioButton("Mayo");
    rdbtnMayo.setForeground(new Color(0, 128, 0));
    rdbtnMayo.setFont(new Font("Arial", Font.BOLD, 12));
    rdbtnMayo.setBackground(new Color(255, 255, 255));
    jpnlStep6.add(rdbtnMayo);

    JRadioButton rdbtnMustard = new JRadioButton("Mustard");
    rdbtnMustard.setForeground(new Color(0, 128, 0));
    rdbtnMustard.setFont(new Font("Arial", Font.BOLD, 12));
    rdbtnMustard.setBackground(new Color(255, 255, 255));
    jpnlStep6.add(rdbtnMustard);

    JRadioButton rdbtnRanch = new JRadioButton("Ranch");
    rdbtnRanch.setForeground(new Color(0, 128, 0));
    rdbtnRanch.setFont(new Font("Arial", Font.BOLD, 12));
    rdbtnRanch.setBackground(new Color(255, 255, 255));
    jpnlStep6.add(rdbtnRanch);

    JRadioButton rdbtnVinegar = new JRadioButton("Vinegar");
    rdbtnVinegar.setForeground(new Color(0, 128, 0));
    rdbtnVinegar.setFont(new Font("Arial", Font.BOLD, 12));
    rdbtnVinegar.setBackground(new Color(255, 255, 255));
    jpnlStep6.add(rdbtnVinegar);

    JRadioButton rdbtnSauceNone = new JRadioButton("No Sauce");
    rdbtnSauceNone.setForeground(new Color(0, 128, 0));
    rdbtnSauceNone.setFont(new Font("Arial", Font.BOLD, 12));
    rdbtnSauceNone.setBackground(new Color(255, 255, 255));
    jpnlStep6.add(rdbtnSauceNone);

    jpnlStep7 = new JPanel();
    jpnlStep7.setBorder(new TitledBorder(new BevelBorder(
    BevelBorder.LOWERED, new Color(0, 128, 0),
    new Color(0, 128, 0), new Color(255, 255, 0), new Color(255,
    255, 0)), "Choose Your Extras!", TitledBorder.LEADING,
    TitledBorder.TOP, null, new Color(0, 128, 0)));
    jpnlStep7.setBackground(new Color(255, 255, 255));
    tabbedPane.addTab("Step7", null, jpnlStep7, "Extra items!");

    JRadioButton rdbtnExMeat = new JRadioButton("Extra Meat: $2.00");
    rdbtnExMeat.setForeground(new Color(0, 128, 0));
    rdbtnExMeat.setFont(new Font("Arial", Font.BOLD, 12));
    rdbtnExMeat.setBackground(new Color(255, 255, 255));
    jpnlStep7.add(rdbtnExMeat);

    JRadioButton rdbtnChips = new JRadioButton("Chips/Apples: $1.00");
    rdbtnChips.setForeground(new Color(0, 128, 0));
    rdbtnChips.setFont(new Font("Arial", Font.BOLD, 12));
    rdbtnChips.setBackground(new Color(255, 255, 255));
    jpnlStep7.add(rdbtnChips);

    JRadioButton rdbtnPop = new JRadioButton("Pop: $1.00");
    rdbtnPop.setForeground(new Color(0, 128, 0));
    rdbtnPop.setFont(new Font("Arial", Font.BOLD, 12));
    rdbtnPop.setBackground(new Color(255, 255, 255));
    jpnlStep7.add(rdbtnPop);

    JRadioButton rdbtnCookie = new JRadioButton("Cookie: $1.00");
    rdbtnCookie.setForeground(new Color(0, 128, 0));
    rdbtnCookie.setFont(new Font("Arial", Font.BOLD, 12));
    rdbtnCookie.setBackground(new Color(255, 255, 255));
    jpnlStep7.add(rdbtnCookie);

    JRadioButton rdbtnExNone = new JRadioButton("None");
    rdbtnExNone.setForeground(new Color(0, 128, 0));
    rdbtnExNone.setFont(new Font("Arial", Font.BOLD, 12));
    rdbtnExNone.setBackground(new Color(255, 255, 255));
    jpnlStep7.add(rdbtnExNone);

    buttonGroupExtras.add(rdbtnExMeat);
    buttonGroupExtras.add(rdbtnPop);
    buttonGroupExtras.add(rdbtnCookie);
    buttonGroupExtras.add(rdbtnChips);
    buttonGroupExtras.add(rdbtnNone);

    JPanel jpnlFinal = new JPanel();
    jpnlFinal.setBorder(new TitledBorder(new BevelBorder(
    BevelBorder.LOWERED, new Color(0, 128, 0),
    new Color(0, 128, 0), new Color(255, 255, 0), new Color(255,
    255, 0)), "Review Your Order!", TitledBorder.LEADING,
    TitledBorder.TOP, null, new Color(0, 128, 0)));
    jpnlFinal.setBackground(new Color(255, 255, 255));
    tabbedPane.addTab("Final Step", null, jpnlFinal, "Review & Submit!");

    JButton jbtnReview = new JButton("Review Order");
    jbtnReview.setForeground(new Color(0, 128, 0));
    jbtnReview.setFont(new Font("Arial", Font.BOLD, 11));
    jpnlFinal.add(jbtnReview);

    jbtnReview.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
    JFrame reviewFrame = new JFrame();
    reviewFrame.setVisible(true);
    reviewFrame.setSize(400, 600);
    JPanel reviewPanel = new JPanel(new GridLayout(12, 1));

    JLabel jlblFirst1 = new JLabel("First Name: "
    + jtxtName.getText());

    reviewPanel.add(jlblFirst1);
    }
    });
    }
    }
    Last edited by pucketter; 12-08-2013 at 10:18 PM.

  2. #2
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,539
    Rep Power
    5

    Default Re: Blank JPanel Issue using an ActionListener

    I think you're missing some code. Where is main?

    Regards,
    Jim
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  3. #3
    pucketter is offline Member
    Join Date
    Dec 2013
    Posts
    5
    Rep Power
    0

    Default Re: Blank JPanel Issue using an ActionListener

    Good question - in another class...all the code compiles except when I hit the review order button - the panel comes up blank.

    public class FinalProject extends Sandwich{

    /**
    * @param args
    */
    public static void main(String[] args) {
    // TODO Auto-generated method stub
    Sandwich frame = new Sandwich();


    frame.setTitle("Sandwich Order Form");// set title bar text
    frame.setSize(600,600);// center the program on the screen
    frame.setLocationRelativeTo(null);//center the frame
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOS E);
    frame.setVisible(true);// display window
    }

    }

  4. #4
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    3,539
    Rep Power
    5

    Default Re: Blank JPanel Issue using an ActionListener

    A couple of things. Your main problem is that you did not add the reviewPanel to the reviewFrame in your actionListener.. Also, when you offer the lettuce, tomato, etc selection, you only allow one of each. You should allow multiple. Also, please place your code between [CODE][/CODE] tags for proper formatting. Go to advanced editor, highlight the code, and hit the # button.

    Regards,
    Jim
    Last edited by jim829; 12-09-2013 at 02:48 AM.
    The Java™ Tutorial | SSCCE | Java Naming Conventions
    Poor planning our your part does not constitute an emergency on my part.

  5. #5
    pucketter is offline Member
    Join Date
    Dec 2013
    Posts
    5
    Rep Power
    0

    Default Re: Blank JPanel Issue using an ActionListener

    Ahhhh - THANK YOU! And of course people would want to select more than one veggie! I'll remove that button group....anyhow I VERY MUCH appreciate your feedback.

Similar Threads

  1. [SOLVED] Empty JTable issue(blank rows)
    By doru.chiulan in forum AWT / Swing
    Replies: 3
    Last Post: 08-10-2012, 08:06 AM
  2. Replies: 1
    Last Post: 12-13-2011, 02:38 AM
  3. Replies: 4
    Last Post: 04-19-2011, 05:09 AM
  4. ActionListener issue.
    By kbro3 in forum New To Java
    Replies: 14
    Last Post: 02-24-2011, 06:08 AM
  5. Replies: 2
    Last Post: 12-10-2009, 12:06 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •