0

I am trying to display a frame if the checkbox "empAppCB" is selected. the name of the frame is EnterEmpInfo ...How do I call EnterEmpInfo from here? I have declared an EnterEmpInfo object called eei and would like to use nested If, else statements to achieve this because i have a checkboxGroup.

   public void itemStateChanged(ItemEvent e) {
      if (empAppCB == e.getSource()){


    }
philjd11
  • 1
  • 2
  • See [The Use of Multiple JFrames, Good/Bad Practice?](http://stackoverflow.com/questions/9554636) – Hovercraft Full Of Eels Mar 16 '16 at 01:18
  • `EnterEmpInfo.setVisible(empAppCB.isSelected()). ` – josivan Mar 16 '16 at 01:18
  • no disrespect intended but that question is entirely different from what I asked..... – philjd11 Mar 16 '16 at 01:45
  • No disrespect taken, but it has significant relevance. You never want to open a 2nd JFrame. But regardless, you should already know how to open any window since your code already opens one window already -- the main window. You just do the same thing. If you're still stuck, ask a better question including showing your attempt to do what you're trying to do. – Hovercraft Full Of Eels Mar 16 '16 at 01:52
  • Okay so can I call the frame from the itemStateChanged (itemEvent) method? My goal with this is when the checkbox is clicked to open my EnterEmpInfo frame which then allows the user to input information and then display that information in another frame, but I can't get it nested in my If, Else statements so that it will call my other frame... – philjd11 Mar 16 '16 at 02:01
  • Again, you **don't want to open another JFrame**. It would be non-modal and would make information retrieval very difficult. Much better would be to open a modal JDialog, something which is mentioned in the link I've given. – Hovercraft Full Of Eels Mar 16 '16 at 02:14
  • I 100% absolutely need this to open another frame. – philjd11 Mar 16 '16 at 02:17

0 Answers0