2

Hi I am using JFrame to design swing application on clicking a menu in JFrame my requirement is to add JInternal frame on the JFrame and its working . Now the problem is that i want to refresh the Jframe according to the button clicked on jinternalframe and close the current JInternal Frame. How is it possible on button click of the JInternal frame i am using the following code

  try
   {
  MainForm frm= new Mainform();
  frm.cp.add("adding here JEditor Pane");
 this..dispose();
   }
 catch(Exception ex)
 {
  }

its working and also closing the JinternalFrame but the page of JFrame form is opened in new window not refreshing the previous one can you suggest me the code plz

thanks a lot in advance

adesh
  • 1,157
  • 3
  • 18
  • 28

1 Answers1

6
  • part of your question are explained in the Oracle tutorial How to Use Internal Frames

  • rest is described in the Rules of Using Internal Frames

  • read How to Use Buttons and How to Write an Action Listener

  • in the case that you'll a real question, the post an SSCCE demonstraded your issue(s) with JButton, ActionListener and JInternalFrames

  • I'd be reuse JInternalFrames and change only their visibily on the screen

mKorbel
  • 109,525
  • 20
  • 134
  • 319