-1

I have a JApplet program with multiple classes. RegPanel,WorkshopPanel, CnferenceGUI, CnferenceHandler and CnferenceClient. Basically RegPanel and WorkShop panel are added to the CnferenceGUI, which also creates and adds a couple small panels. The CnferenceClient class is just used to initaite the class to run the applet. The CnferenceHandler is used to handle the action events for the JButtons, JTextArea, JCheckBox, etc... Here's my problem;

In the CnferenceGUI class i add action listeners to the buttons/combobox and the program runs just fine. But when I add in the code for the listener on the JCheckBox the entire applet becomes blank. Anyone know why this is?

here is the constructor in the CnferenceGUI class:

public ConferenceGUI()
   {
       setLayout(new BorderLayout());

       titlePanel = new JPanel();

       titleLabel = new JLabel("Select Registration Options",JLabel.CENTER);

       Font titleFont = new Font("SansSerif", Font.BOLD, 18);

       titleLabel.setFont(titleFont);

       titlePanel.add(titleLabel);

       add(titlePanel, BorderLayout.NORTH);

       regPanel = new RegPanel();
       add(regPanel, BorderLayout.WEST);

       workshopPanel = new WorkshopPanel();
       add(workshopPanel, BorderLayout.EAST);

       buildButtonPanel();
       add(buttonPanel, BorderLayout.SOUTH);

       ConferenceHandler handler = new ConferenceHandler(this);

       regPanel.regTypeComboBox.addItemListener(handler);
       regPanel.regNameTextBox.addFocusListener(handler);

       // This is the line that make the entire applet blank if included
       regPanel.keynoteCheckBox.addItemListener(handler);



   }    
Hovercraft Full Of Eels
  • 283,665
  • 25
  • 256
  • 373
Stan Harris
  • 15
  • 1
  • 4
  • 2
    When asking for debugging help, essentially, "why isn't this code working as expected?" help, you really should create and post the shortest code necessary for us to be able to compile, run and help identify your problem, a [mcve] (please check the link). Else, we're not going to be able to help well other than to give very general and vague advice, or a referal to a tutorial. And yes, what I'm requesting would not be an easy or quick thing to do as it would require quite a bit of effort on your part, but if you remain stuck and need a solution to this, it would be effort well spent. – Hovercraft Full Of Eels Oct 22 '15 at 03:52

1 Answers1

0

Sounds like unhandled exception occurs during applet construction! Please, verify console output. Adding handler to the checkbox can't cause such problem.

Ivan Dubynets
  • 342
  • 1
  • 3
  • 12
  • It does cause such a problem. The code without the commented line works just fine, once the line is added in the applet it blank. It makes no sense to me at all but that's what happens. If it helps i'm using blueJ. – Stan Harris Oct 22 '15 at 04:21
  • 1
    *"If it helps i'm using blueJ."* What would help most is if you followed the advice offered by @HovercraftFullOfEels almost half an hour prior to your comment.. – Andrew Thompson Oct 22 '15 at 04:42
  • no need for the aggression, I'm in the process of reworking my post. – Stan Harris Oct 22 '15 at 05:09
  • @StanHarris: we're ready to help anytime you're ready to finish reworking your post. – Hovercraft Full Of Eels Oct 22 '15 at 23:04