GUI building difficulties, nested Frames and other stuff

I am currently working on a GUI and I am running into some difficulties. I have created a class which extends JFrame
public class DelFace extends JFrame implements ActionListener, ItemListenerI am instantiating an object of this class from within another object of a different class as follows:
DelFace DelGUI = new DelFace(this,MastFile);The creation of the object takes place within the listener methods of another object:
public void actionPerformed(ActionEvent e)
  if(e.getActionCommand().equals("Delete"))
      DelFace DelGUI = new DelFace(this,MastFile);
  }The class that creates the object that makes this call does not contain the main method. Instead the afore mentioned object is created from a class that extends JFrame
class GUI extends JFrame implements ActionListenerSo the code in it's order of activity is as follows:
It breaks down hardcore at the beginning
public class StartProgram {
  private static GUI LauncherGUI;
  private static FileOps MastFile;
  public static void main(String[] args)
  MastFile = new FileOps();
  MastFile.fileStatus();            //Create File object &/or file.
  MastFile.readFile();              //Read file contents if any.
  LauncherGUI = new GUI(StartProgram.MastFile);
}A GUI object is created, - LauncherGUI = new GUI(StartProgram.MastFile);
From here the code differentiates somewhat - FileOperations stem from here as do all code related to the complete construction of the General User Interface.
Specifically my difficulties lie with the GUI, therefore I will present the next peice of code related to the GUI. The following code creates a JFrame and places a whole stack of buttons on it. Included with these buttons are menus. So basically the code creates a menu bar and adds menu items to that bar and so on until a menu similar to that found in any regular program is produced. Also contained on this part of the GUI are the five buttons that are fundemental to the programs operation.
import java.io.*;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.util.EventObject; //Try removing this!!
class GUI extends JFrame implements ActionListener
  private JButton button1;
  private JButton button2;
  private JButton button3;
  private JButton button4;
  private JButton button5;
  private String Path1;
  private String Path2;
  private String Path3;
  private String Path4;
  private String Path5;
  private FileOps MastFile;
  private DataEntryBox EntryBox;
  private HelpGUI Instruct;
  FrameListener GUIListener = new FrameListener();  //Listener object created.
  GUI(FileOps MastFile)
    this.MastFile = MastFile;          //Make MastFile objects methods available
                                       //to all of LauncherGUI object.
    Toolkit tk = Toolkit.getDefaultToolkit();       //intialize the toolkit.
    Dimension sSize = tk.getScreenSize();           //determine screen size.
    Container c = getContentPane();
    GridBagLayout gridbag2 = new GridBagLayout();    //GridBagLayout object
                                                    //instantiated.
    GridBagConstraints d = new GridBagConstraints();//GridBagConstraints object
                                                    //instantiated.
    c.setLayout(gridbag2);                          //Content pane's layout set
                                                    //to gridbag object.
    d.fill = GridBagConstraints.BOTH;               //Make all components fill
                                                    //their dispaly areas
                                                    //entirely.
    d.insets = new Insets(5,1,5,1);
    JMenuBar menuBar = new JMenuBar();  //Creates Menubar object called menuBar.
    setJMenuBar(menuBar);
    JMenu FMenu = new JMenu("File");    //File Menu object instantiated.
    FMenu.setMnemonic(KeyEvent.VK_F);   //Key that activates File menu...F.
    menuBar.add(FMenu);                 //File Menu added to menuBar object.
    JMenuItem NewItem = new JMenuItem("New");   //Creates New sub-menu object.
    NewItem.setMnemonic(KeyEvent.VK_N);         //Key that activates New sub-
                                                //menu....N.
    FMenu.add(NewItem);
    NewItem.addActionListener(this);   //ActionListner for NewItem added.
    //Tutorial Note: Steps involved in creating a menu UI are as follows,
    //1). Create an instance of a JMenuBar.
    //2). Create an instance of a JMenu.
    //3). Add items to the JMenu (not to the JMenuBar).
    //Note: It is possible to include the Mnemonic activation key as part of
    //the JMenu or JMenuItem constructor. e.g.: JMenuItem NewItem = new JMenu
    //Item("New",KeyEvent.VK_N);
    JMenuItem DeleteItem = new JMenuItem("Delete");
    DeleteItem.setMnemonic(KeyEvent.VK_D);
    FMenu.add(DeleteItem);
    DeleteItem.addActionListener(this);
    JMenuItem ExitItem = new JMenuItem("Exit",KeyEvent.VK_E); //Mnemonic key
    //included with constructor method here and from now on.
    FMenu.add(ExitItem);
    ExitItem.addActionListener(this);
    JMenu HMenu = new JMenu("Help");
    HMenu.setMnemonic(KeyEvent.VK_H);
    menuBar.add(HMenu);
    JMenuItem InstructItem = new JMenuItem("Instructions",KeyEvent.VK_I);
    HMenu.add(InstructItem);
    InstructItem.addActionListener(this);
    JMenuItem AboutItem = new JMenuItem("About",KeyEvent.VK_A);
    HMenu.add(AboutItem);
    AboutItem.addActionListener(this);
    button1 = new JButton();
/* The following if statments block first checks to see if the value held in the
String array is equals to null (note: this only occurs when the program is first
started and no data has been written to file). If the array is null then the
buttons text is set to "". If the array value is not null (meaning that the file
already holds data) then the value of the array is checked. If the value equals
the String "null" then button text is set to "", otherwise button text is set to
the relevant array value (a user defined shortcut name). Also the value of each
buttons actionCommand is set to this string value. */
    if(MastFile.getFDArray(0) == null)
      button1.setText("");
      button1.setActionCommand("Link1");
    else
    if(MastFile.getFDArray(0) != null)
      if(MastFile.getFDArray(0).equals("null"))
        button1.setText("");
        button1.setActionCommand("Link1");
      else
        button1.setText(MastFile.getFDArray(0));
        button1.setActionCommand(MastFile.getFDArray(0));
    d.weightx = 0.2;  //Specifies horizontal sizing behaviour.
    d.weighty = 0.3;  //Specifies vertical resizing behaviour.
    d.gridx = 0;      //c.gridx and c.gridy specify the x,y starting position
    d.gridy = 0;      //of this label, in regard to column and row respectively.
    gridbag2.setConstraints(button1, d);
    c.add(button1);
    button1.addActionListener(this);
    button2 = new JButton();
    if(MastFile.getFDArray(2) == null) //If the file contains no contents then..
      button2.setText("");
      button2.setActionCommand("Link2");
    else
    if(MastFile.getFDArray(2) != null)
      if(MastFile.getFDArray(2).equals("null"))//If the file contains the string
      {                                        //"null" then do as above.
        button2.setText("");
        button2.setActionCommand("Link2");
      else  //Set both button text and actionCommand to relevant shortcut name.
        button2.setText(MastFile.getFDArray(2));
        button2.setActionCommand(MastFile.getFDArray(2));
    d.weightx = 0.2;  //Specifies horizontal sizing behaviour.
    d.weighty = 0.3;  //Specifies vertical resizing behaviour.
    d.gridx = 1;      //c.gridx and c.gridy specify the x,y starting position
    d.gridy = 0;      //of this label, in regard to column and row respectively.
    gridbag2.setConstraints(button2, d);
    c.add(button2);
    button2.addActionListener(this);
    button3 = new JButton();
    if(MastFile.getFDArray(4) == null)
      button3.setText("");
      button3.setActionCommand("Link3");
    else
    if(MastFile.getFDArray(4) != null)
      if(MastFile.getFDArray(4).equals("null"))
        button3.setText("");
        button3.setActionCommand("Link3");
      else
        button3.setText(MastFile.getFDArray(4));
        button3.setActionCommand(MastFile.getFDArray(4));
    d.weightx = 0.2;  //Specifies horizontal sizing behaviour.
    d.weighty = 0.3;  //Specifies vertical resizing behaviour.
    d.gridx = 2;      //c.gridx and c.gridy specify the x,y starting position
    d.gridy = 0;      //of this label, in regard to column and row respectively.
    gridbag2.setConstraints(button3, d);
    c.add(button3);
    button3.addActionListener(this);
    button4 = new JButton();
    if(MastFile.getFDArray(6) == null)
      button4.setText("");
      button4.setActionCommand("Link4");
    else
    if(MastFile.getFDArray(6) != null)
      if(MastFile.getFDArray(6).equals("null"))
        button4.setText("");
        button4.setActionCommand("Link4");
      else
        button4.setText(MastFile.getFDArray(6));
        button4.setActionCommand(MastFile.getFDArray(6));
    d.weightx = 0.2;  //Specifies horizontal sizing behaviour.
    d.weighty = 0.3;  //Specifies vertical resizing behaviour.
    d.gridx = 3;      //c.gridx and c.gridy specify the x,y starting position
    d.gridy = 0;      //of this label, in regard to column and row respectively.
    gridbag2.setConstraints(button4, d);
    c.add(button4);
    button4.addActionListener(this);
    button5 = new JButton();
    if(MastFile.getFDArray(8) == null)
      button5.setText("");
      button5.setActionCommand("Link5");
    else
    if(MastFile.getFDArray(8) != null)
      if(MastFile.getFDArray(8).equals("null"))
        button5.setText("");
        button5.setActionCommand("Link5");
      else
        button5.setText(MastFile.getFDArray(8));
        button5.setActionCommand(MastFile.getFDArray(8));
    d.weightx = 0.2;  //Specifies horizontal sizing behaviour.
    d.weighty = 0.3;  //Specifies vertical resizing behaviour.
    d.gridx = 4;      //c.gridx and c.gridy specify the x,y starting position
    d.gridy = 0;      //of this label, in regard to column and row respectively.
    gridbag2.setConstraints(button5, d);
    c.add(button5);
    button5.addActionListener(this);
    Path1 = MastFile.getFDArray(1);       //Load Path variables with path
    Path2 = MastFile.getFDArray(3);       //details from String Array in
    Path3 = MastFile.getFDArray(5);       //MastFile object of FileOps class.
    Path4 = MastFile.getFDArray(7);       //Effectively loading these variables
    Path5 = MastFile.getFDArray(9);       //with file data.
    this.addWindowListener(GUIListener);  //Listener registered with Frame.
    setLocation(sSize.width*1/2,sSize.height*1/20);
    setSize(sSize.width*1/2,sSize.height*1/7);
    setTitle("Java QuickLaunch Toolbar");
    setVisible(true);
  /* The following methods return the ActionCommand and Text Label
     String values of the buttons */
  public String getButton1Command()
    return button1.getActionCommand();
  public String getButton2Command()
    return button2.getActionCommand();
  public String getButton3Command()
    return button3.getActionCommand();
  public String getButton4Command()
    return button4.getActionCommand();
  public String getButton5Command()
    return button5.getActionCommand();
  public String getBt1Text()
    return button1.getText();
  public String getBt2Text()
    return button2.getText();
  public String getBt3Text()
    return button3.getText();
  public String getBt4Text()
    return button4.getText();
  public String getBt5Text()
    return button5.getText();
  /* The following methods set the Path, Button and ActionCommand String values. */
  public void setPath1(String setPath)
    Path1 = setPath;
  public void setPath2(String setPath)
    Path2 = setPath;
  public void setPath3(String setPath)
    Path3 = setPath;
  public void setPath4(String setPath)
    Path4 = setPath;
  public void setPath5(String setPath)
    Path5 = setPath;
  public void setButton1(String setButton)
    button1.setText(setButton);
  public void setButton2(String setButton)
    button2.setText(setButton);
  public void setButton3(String setButton)
    button3.setText(setButton);
  public void setButton4(String setButton)
    button4.setText(setButton);
  public void setButton5(String setButton)
    button5.setText(setButton);
  public void setBt1Action(String setAct)
    button1.setActionCommand(setAct);
  public void setBt2Action(String setAct)
    button2.setActionCommand(setAct);
  public void setBt3Action(String setAct)
    button3.setActionCommand(setAct);
  public void setBt4Action(String setAct)
    button4.setActionCommand(setAct);
  public void setBt5Action(String setAct)
    button5.setActionCommand(setAct);
  /* actionPerformed methods */
  public void actionPerformed(ActionEvent e)
    if(e.getActionCommand().equals("New"))
      //Create a data entry box.
      EntryBox = new DataEntryBox(this,MastFile);
    else
    if(e.getActionCommand().equals("Delete"))//Example part of interest
      DelFace DelGUI = new DelFace(this,MastFile);   /// -------- ////
    else
    if(e.getActionCommand().equals("Exit"))
      System.exit(0);
    else
    if(e.getActionCommand().equals("Instructions"))
      Instruct = new HelpGUI();
    else
    if(e.getActionCommand().equals("About"))
      JOptionPane.showMessageDialog(this,"Java QuickLaunch Toolbar created by David "+
                                    "Dartnell.","Programming Credits",1);
    else
      if(e.getActionCommand().equals(button1.getActionCommand())) //Determine source of event.
      if(Path1 == null)                        //If Path var is a null reference
        EntryBox = new DataEntryBox(this,MastFile);//create a data entry box.
      else
      if(Path1 != null)                        //If not a null reference then...
        if(Path1.equals("null"))               //Determine if string is "null".
          EntryBox = new DataEntryBox(this,MastFile);
        else        //If both the reference and the String are not null then run
        {           //the relevant command/program.
          try
            Runtime.getRuntime().exec(new String[]{Path1});
          catch(IOException run){}
    else
    if(e.getActionCommand().equals(button2.getActionCommand()))
      if(Path2 == null)
        EntryBox = new DataEntryBox(this,MastFile);
      else
      if(Path2 != null)
        if(Path2.equals("null"))
          EntryBox = new DataEntryBox(this,MastFile);
        else
          try
            Runtime.getRuntime().exec(new String[]{Path2});
          catch(IOException run){}
    else
    if(e.getActionCommand().equals(button3.getActionCommand()))
      if(Path3 == null)
        EntryBox = new DataEntryBox(this,MastFile);
      else
      if(Path3 != null)
        if(Path3.equals("null"))
          EntryBox = new DataEntryBox(this,MastFile);
        else
          try
            Runtime.getRuntime().exec(new String[]{Path3});
          catch(IOException run){}
    else
    if(e.getActionCommand().equals(button4.getActionCommand()))
      if(Path4 == null)
        EntryBox = new DataEntryBox(this,MastFile);
      else
      if(Path4 != null)
        if(Path4.equals("null"))
          EntryBox = new DataEntryBox(this,MastFile);
        else
          try
            Runtime.getRuntime().exec(new String[]{Path4});
          catch(IOException run){}
    else
    if(e.getActionCommand().equals(button5.getActionCommand()))
      if(Path5 == null)
        EntryBox = new DataEntryBox(this,MastFile);
      else
      if(Path5 != null)
        if(Path5.equals("null"))
          EntryBox = new DataEntryBox(this,MastFile);
        else
          try
            Runtime.getRuntime().exec(new String[]{Path5});
          catch(IOException run){}
Something to consider concerning actionListeners:
It must be remembered that String values are in fact objects and as such
they require the equals() method unlike their cousins the primitive data
types (int, float, boolean, byte, short, long and double) which require
the == operator.
*/A comment is placed next to the line of code that is of interest to my problem (///-------////).
When a button is pressed in the menu section that reads "Delete" then an actionCommand event is fired and the program responds by creating a second general user interface.
When DelFace is instantiated in the form of the object called DelGUI I am once again creating an object which extends JFrame. I now have two objects of type JFrame on the screen at once, and I conveniently position one over the top of the other, so to the general user the programs appearance has changed in only very specified ways (i.e.: I have decided to increase the GUI's dimensions in the area of height only and not width). The code that constitutes class DelFace is as follows:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class DelFace extends JFrame implements ActionListener, ItemListener
  private GUI TkBar;        //GUI object.
  private FileOps Fops;     //File Operations object.
  private JCheckBox ckbox1; //Delete shortcut 1.
  private JCheckBox ckbox2; //Delete shortcut 2.
  private JCheckBox ckbox3; //Delete shortcut 3.
  private JCheckBox ckbox4; //Delete shortcut 4.
  private JCheckBox ckbox5; //Delete shortcut 5.
  private JButton OkBtn;    //OK button.
  private JButton CnBtn;    //Cancel button.
  private JOptionPane confirm;
  private boolean short1 = false;  //Boolean variables indicate whether to
  private boolean short2 = false;  //delete a shortcut entry. True = delete.
  private boolean short3 = false;
  private boolean short4 = false;
  private boolean short5 = false;
  DelFace(GUI TkBar, FileOps Fops)
    this.TkBar = TkBar;
    this.Fops = Fops;
    Toolkit tk = Toolkit.getDefaultToolkit();
    Dimension sSize = tk.getScreenSize();
    Container dcon = getContentPane();
    GridBagLayout gb = new GridBagLayout();
    GridBagConstraints bagcon = new GridBagConstraints();
    dcon.setLayout(gb);
    bagcon.fill = GridBagConstraints.BOTH;
    bagcon.gridwidth = GridBagConstraints.REMAINDER;
    JLabel TLabel = new JLabel("Delete Wizard",JLabel.CENTER);
    TLabel.setFont(new Font("Tahoma",Font.BOLD+Font.ITALIC,32));
    bagcon.gridx = 0;
    bagcon.gridy = 0;
    bagcon.weightx = 1.0;      //Take up all the 'x room' in this row.
    bagcon.weighty = 0.5;      //Take up all the 'y room' in this column.
    /* The weightx and weighty values are required otherwise all components will
       gravitate toward the center of screen. */
    gb.setConstraints(TLabel,bagcon);
    dcon.add(TLabel);
    JTextArea TxArea = new JTextArea("Tick the box(s) of the shortcut(s)"+
                           " that you would like to delete and"+
                           " press the Delete button. Alternatively"+
                           " press the Cancel button to exit.");
    TxArea.setLineWrap(true);
    TxArea.setWrapStyleWord(true);
    TxArea.setEditable(false);
    TxArea.setFont(new Font("Times New Roman",Font.PLAIN,15));
    TxArea.setBackground(this.getBackground());
    bagcon.gridx = 0;
    bagcon.gridy = 1;
    gb.setConstraints(TxArea,bagcon);
    dcon.add(TxArea);
    bagcon.gridwidth = 1;
    JPanel Nopan1 = new JPanel();
    bagcon.gridx = 0;
    bagcon.gridy = 2;
    gb.setConstraints(Nopan1,bagcon);
    dcon.add(Nopan1);
    ckbox1 = new JCheckBox(TkBar.getBt1Text());
    bagcon.gridx = 1;
    bagcon.gridy = 2;
    gb.setConstraints(ckbox1,bagcon);
    dcon.add(ckbox1);
    ckbox1.addItemListener(this);
    ckbox2 = new JCheckBox(TkBar.getBt2Text());
    bagcon.gridy = 3;
    gb.setConstraints(ckbox2,bagcon);
    dcon.add(ckbox2);
    ckbox2.addItemListener(this);
    ckbox3 = new JCheckBox(TkBar.getBt3Text());
    bagcon.gridy = 4;
    gb.setConstraints(ckbox3,bagcon);
    dcon.add(ckbox3);
    ckbox3.addItemListener(this);
    ckbox4 = new JCheckBox(TkBar.getBt4Text());
    bagcon.gridy = 5;
    gb.setConstraints(ckbox4,bagcon);
    dcon.add(ckbox4);
    ckbox4.addItemListener(this);
    ckbox5 = new JCheckBox(TkBar.getBt5Text());
    bagcon.gridy = 6;
    gb.setConstraints(ckbox5,bagcon);
    dcon.add(ckbox5);
    ckbox5.addItemListener(this);
    JPanel Nopan2 = new JPanel();
    bagcon.gridx = 1;
    bagcon.gridy = 7;
    gb.setConstraints(Nopan2,bagcon);
    dcon.add(Nopan2);
    OkBtn = new JButton("OK");
    OkBtn.addActionListener(this);
    bagcon.gridx = 1;
    bagcon.gridy = 8;
    gb.setConstraints(OkBtn,bagcon);
    dcon.add(OkBtn);
    OkBtn.addActionListener(this);
    CnBtn = new JButton("Cancel");
    CnBtn.addActionListener(this);
    bagcon.gridx = 2;
    bagcon.gridy = 8;
    gb.setConstraints(CnBtn,bagcon);
    dcon.add(CnBtn);
    CnBtn.addActionListener(this);
    JPanel Nopan3 = new JPanel();
    bagcon.gridx = 3;
    bagcon.gridy = 8;
    gb.setConstraints(Nopan3,bagcon);
    dcon.add(Nopan3);
    JPanel Nopan4 = new JPanel();
    bagcon.gridx = 0;
    bagcon.gridy = 9;
    gb.setConstraints(Nopan4,bagcon);
    dcon.add(Nopan4);
    setLocation(sSize.width*1/2,sSize.height*1/20);
    setSize(sSize.width*1/2,sSize.height*4/5);
    setTitle("Java QuickLaunch Toolbar");
    setResizable(false);
    setVisible(true);
  public void actionPerformed(ActionEvent e)
  { /*--- Code of INTEREST begins here!!!!!! -------
    if(e.getActionCommand().equals("OK"))   
      if(short1 || short2 || short3 || short4 || short5)
        //confirm = new JOptionPane();
        int n = confirm.showConfirmDialog(this,
             "Do you really want to delete?","Delete Confirmation",
             JOptionPane.YES_NO_OPTION);
        if(n == confirm.YES_OPTION)  //Works Fine!
          while(short1 || short2 || short3 || short4 || short5)
            if(short1)
              TkBar.setBt1Action("Link1");
              TkBar.setButton1("");
              TkBar.setPath1("null");
              Fops.setFDArray(0,"null");
              Fops.setFDArray(1,"null");
              short1 = false;
            else
            if(short2)
              TkBar.setBt2Action("Link2");
              TkBar.setButton2("");
              TkBar.setPath2("null");
              Fops.setFDArray(2,"null");
              Fops.setFDArray(3,"null");
              short2 = false;
            else
            if(short3)
              TkBar.setBt3Action("Link3");
              TkBar.setButton3("");
              TkBar.setPath3("null");
              Fops.setFDArray(4,"null");
              Fops.setFDArray(5,"null");
              short3 = false;
            else
            if(short4)
              TkBar.setBt4Action("Link4");
              TkBar.setButton4("");
              TkBar.setPath4("null");
              Fops.setFDArray(6,"null");
              Fops.setFDArray(7,"null");
              short4 = false;
            else
            if(short5)
              TkBar.setBt5Action("Link5");
              TkBar.setButton5("");
              TkBar.setPath5("null");
              Fops.setFDArray(8,"null");
              Fops.setFDArray(9,"null");
              short5 = false;
          Fops.destroyFile();   //Destroy the old (outdated) file.
          Fops.fileStatus();    //Create a new file.
          Fops.writeFile();     //Write updated data to new file.
          setVisible(false);
        if(n == confirm.NO_OPTION)  //** Does not work ***
          System.out.println("No Option is being heard");
          //Listeners are working.
          //confirm.setVisible(false);
        if(n == confirm.CLOSED_OPTION) //** Does not work ***
          System.out.println("Closed Option is being heard");
          //Listeners are working.
          //confirm.setVisible(false);
    --- Code of interest ENDS here --- */
    else
    if(e.getActionCommand().equals("Cancel"))
      setVisible(false); 
  public void itemStateChanged(ItemEvent f)
    int state = f.getStateChange();
    if(state == ItemEvent.SELECTED)   //If a checkbox has been selected.
      if(f.getItem() == ckbox1)
        short1 = true;
      else
      if(f.getItem() == ckbox2)
        short2 = true;
      else
      if(f.getItem() == ckbox3)
        short3 = true;
      else
      if(f.getItem() == ckbox4)
        short4 = true;
      else
      if(f.getItem() == ckbox5)
        short5 = true;
    if(state == ItemEvent.DESELECTED)  //If a checkbox has been deselected.
      if(f.getItem() == ckbox1)
        short1 = false;
      else
      if(f.getItem() == ckbox2)
        short2 = false;
      else
      if(f.getItem() == ckbox3)
        short3 = false;
      else
      if(f.getItem() == ckbox4)
        short4 = false;
      else
      if(f.getItem() == ckbox5)
        short5 = false;
}The code that is of interest to my current programming challenge is marked in the above code block like this:
//*** Code of INTEREST begins here!!!!!! ********** //
This is where my programming twilight behaviour begins to kick in. From the DelGUI object I now listen to a button event, this event when triggered causes a JOptionPane.showConfirmDialog(), as can be seen in the specified code block above. I make the JOptionPane centered over the DelGUI object ("JFrame No.: 2") which is also centered over the LauncherGUI object ("JFrame No.: 1").
The program begins to behave quite strangely after the creation of the JOptionPane object called confirm. The JOptionPane is presented on screen without any visiual difficulty but it behaves quite strangely when it's buttons are pressed. The JOptionPane contains three event sources, the YES, NO and Close buttons.
In my program the YES button causes a set of file operations to take place and then sets the "JFrame No.: 2"(DelGUI) invisible. It does this via the method setVisible(false). "JFrame No.: 2" is effectively the JOptionPane's parent component and as soon as it is setVisible(false) the JOptionPane is also cleared from the screen. I believe from my research that this is the JOptionPane's default behaviour, meaning that as soon as a button or event source is activated the JOptionPane will destroy itself.
The end of the trail is near, thankyou for reading this if you have got this far, and please carry on....
The Challenge:
The program does not behave as desired at the two points in the code commented as such: ** Does not work ***
if(n == confirm.NO_OPTION)
          System.out.println("No Option is being heard");
          //confirm.setVisible(false);
        if(n == confirm.CLOSED_OPTION)
          System.out.println("Closed Option is being heard");
          //confirm.setVisible(false);
        }If the NO_OPTION or the CLOSED_OPTION are pressed then the JOptionPane remains visible. After pressing the JoptionPane's button a second time it will disappear completely. I have tried a number of things in an attempt to work this out. Firstly I have inserted println messages to ensure that the events are being detected. These messages are always displayed whenever either the NO or Close buttons are pressed.
As these messages are being passed to the Standard Output, twice by the time the JOptionPane has disappeared, I can only assume that the events are being detected.
In addition to checking the event situation I have attempted to explicity set the JOptionPane invisible, in the form:
confirm.setVisible(false); The above line of code did not change the situation. Still I need two button clicks for the JOptionPane to display it's default behaviour which is to set itself invisible (or possibly the object is alloted to garbage collection), either way it is no longer on screen. I have also tried this code with no if statements related to NO_OPTION and CLOSE_OPTION. This was done in an attempt to allow the default behaviour to take place. Unfortunately two presses were still required in this situation.
A forum member mentioned the possibility that two JOptionPanes are being created. I have checked my code and am confident that I have not explicitly created the JOptionPane twice (the code throughout this question should support this).
Is it possible that two JOptionPanes are being created because of the nature of my code, the fact that there are two JFrames on the screen at once when the JOptionPane is instantiated? I am using the this keyword to specify the parent of the JOptionPan

Well, I've checked your code and I've seen where is the error.
In Delface constructor (Delface.java, line 127), you've got this block of code :
1. OkBtn = new JButton("OK");
2. OkBtn.addActionListener(this);
3. bagcon.gridx = 1;
4. bagcon.gridy = 8;
5. gb.setConstraints(OkBtn,bagcon);
6. dcon.add(OkBtn);
7. OkBtn.addActionListener(this);
Have a deep look at lines 2 and 7 : you're registering twice an actionListener on this button. Then you're receiving twice the event and it shows two JOptionPanes. In fact, you've also the problem with the 'ok' option, but you don't see it, because the 'n' variable in your event handler is global to your class, then it's shared between the two calls to the event handlers.

Similar Messages

  • TS2446 If i create a new apple id account on my ipod, will i still have all my music, apps, books and other stuff on my ipod that i downloaded and bought with my old account or will i loose everything; will i be able to still do the updates to those apps?

    If I create a new apple id account on my ipod, will I still have all my music, apps, books and other stuff on my ipod that I downloaded and bought with my old account or will I loose everything; will I be able to still do the updates to those apps?
    I really need help!

    I don't think you understood what I wrote. You don't HAVE to pay for everything if you are happy with using the other account for updates, etc. But if you don't want to do that then you will have to buy new copies of everything for the new account. There's only one purchase item per account, but you can redownload an item in the account many times.
    The idea is this:
    One computer, multiple devices, one Apple ID.
    One user, multiple devices, one Apple ID.
    The basic idea is that each user has an Apple ID under which he/she can manage multiple devices on a single computer.
    Once you step outside of that model you create such problems as not being able to use or update apps purchase under one Apple ID when using a different Apple ID. Or not being able to easily sync one device on more than one computer.

  • I know that iCloud backs-up apps and other stuff to your phone incase you want restore from a back-up if you start a New iPhone. My question is if I start a new iPhone (not use the restore from back-up option) and redownload apps like (games, Instagram),

    I know that iCloud backs-up apps and other stuff to your phone incase you want restore from a back-up if you start a New iPhone. My question is if I start a new iPhone (not use the restore from back-up option) and redownload apps like (Games, Instagram), would my pics show up on Instagram and would my Games show it was saved and the acccomplisments will remain from the last place I left out.

    Davin12 wrote:
    I know that iCloud backs-up apps and other stuff to your phone incase you want restore from a back-up if you start a New iPhone. My question is if I start a new iPhone (not use the restore from back-up option) and redownload apps like (Games, Instagram), would my pics show up on Instagram and would my Games show it was saved and the acccomplisments will remain from the last place I left out.
    Icloud or itunes backup, only backs up app data, not the app itself.
    so if you restore as new, then there is no app data on your phone, you start out new...

  • I cant create account because i dont have credit card but I have ipod touch and I need it to download free games and other stuff

    I cant create account because i dont have credit card but I have ipod touch and I need it to download free games and other stuff.Is there any option i can write i dont have any credit card?
    Sorry abaot my english

    Hi...
    Click None in the Payment Information window.
    Instructions for either using your iPhone or a computer > Creating an iTunes Store, App Store, iBookstore, and Mac App Store account without a credit card

  • All of a sudden, new tabs have started opening up (in Firefox) advertising games and other stuff. Any idea's of what is going on here?

    All of a sudden, new tabs have started opening up (in Firefox) advertising games and other stuff. Any idea's of what is going on here?

    Try scanning for malware using the removal tools listed near the bottom of the [[Troubleshoot Firefox issues caused by malware]] article.
    It might also help if you could copy and paste troubleshooting information into your reply. See [[Use the Troubleshooting Information page to help fix Firefox issues]] for details.

  • I had to replace my i4s with another one from the apple store.shouldn't i be able to go to the cloud to get all my contact info and other stuff that was stored in the cloud from the first phone?

    i had to replace my i4s phone with another one from the apple store. i need to download all my contact info and other stuff from the cloud to my new phone.i see a screen that says  RESTORE I PHONE   and are you sure you want to restore the iphone to its facory settings?  all of your media and other data will be erased. they i tunes will verify restore with apple. After this you will have the option to restore your contacts and other settins.  The question is will it restore my first phones info?  I am hesitant to delete anything  lol.

    No. If you made your backup to iCloud, iTunes will not restore from an iCloud backup. See:
    iOS: Backing Up and Restoring Data to a New Device

  • I have a problem, my wife has an ipad with photos , emails etc etc, she has recently got herself a new iPad Air, has now been using that for two or more months, more photos (new) more emails and other stuff. Will send next query as running out of room to

    I have a problem, my wife has an ipad with photos , emails etc etc, she has recently got herself a new iPad Air, has now been using that for two or more months, more photos (new) more emails and other stuff. What she wants to do is get all she wants from ipad 1 to new ipad without finishing up with 2 of everything which happen on previous occasion. I realise that she needs to tidy up ipad 1 first and get rid of thousands of emails etc. I need help.
    Thanks kiwihdrider

    Hi yes that works well when the new ipad hasn't been used. Trouble new one has been used for two months or more, has lots photos email etc etc. I am worried that these will go. When we did iPhone thru same process finished up with two of most things pics and emails. The emails alone were over 2 thousand and wife reluctant to delete them all. I would and just sort pics. Any other ideas
    Ta

  • HT1491 My iTunes only show: iTunes U and category , no music and books and other stuffs.

    My iTunes only show: iTunes U and category , no music and books and other stuffs. Is it because of my Chinese ID?

    You can only purchase content from the store where your credit card is registered - and that credit card must be registered to a valid address in that country. I am afraid that you are restricted in what you can legally purchase from Apple.
    Sometimes the restiction of content has to do with licensing rights and sometimes governments will restrict the content that Apple is allowed to sell in their countries.

  • If i upgrade to mountain lion (from lion), will i need to reinstall my windows VM? and what about my apps and other stuff? will those need to be reinstalled too?

    if i upgrade to mountain lion (from lion), will i need to reinstall my windows VM? and what about my apps and other stuff? will those need to be reinstalled too?

    I started off with problems about being in the wrong region and now  have Plug- in Failure
    I am trying to access Setanta Sports Australia which requires
    Microsoft Silverlight and was already pre-installed on a Macbook Pro Retina 2.5 ghz Intel core i5 with Mountain Lion 2.8.3
    I have these different PlugIns active :
    file://localhost/Library/Internet%20Plug-Ins/DivXBrowserPlugin.plugin/
    file://localhost/Library/Internet%20Plug-Ins/Flash%20Player.plugin/
    file://localhost/Library/Internet%20Plug-Ins/JavaAppletPlugin.plugin/
    file://localhost/Library/Internet%20Plug-Ins/QuickTime%20Plugin.plugin/
    file://localhost/Library/Internet%20Plug-Ins/Silverlight.plugin/

  • How to backup all my Firefox "Options", not the bookmarks and other stuff.

    Under Tools, Options there are lot of settings that are lost when I have to reinstall. How to backup all my Firefox "Options", not the bookmarks and other stuff.

    Hi, please see [[Profiles - Where Firefox stores your bookmarks, passwords and other user data]].
    Also - [[Uninstall Firefox from your computer]].
    Hope that helps.

  • My friends put cydia on my ipod and other stuff from it like something who slide your apps differently how can i remove the both, plz help ..???

    My friend put cydia on my ipod and other stuff from it like something who slide your apps differently. How can I remove the both, I really want, plz help ...?

    They hacked it and may have caused damage to your device. Jailbreaking also voids your warranty and support from Apple. To restore to a clean state, restore in Recovery Mode: http://support.apple.com/kb/HT1808

  • Bugs in Tone and other stuff

    My LR4 beta problems.
    File is a NEF, overexposed image for testing. I did try this on several files and different OS (well, still Windows 7 32 bit, but not the same machine).
    Exposure set to -5, Whites set to 0.
    Now Whites is set just to -1. The jump is huge! Why is this?
    Another example.
    For testing, underexposed image.
    In old 2010 Fill Light, the result is this:
    In new 2012 with Shadows, almost nothing.
    And how can Whites be more like Fill Light?
    Even more, a full +100 on Whites will make the Highlights to act strange in my opinion. -100 Highlights makes the image even brighter. +100 makes it darker. I have a screen with the same file as a Jpeg. I guess there is nothing wrong with NEF files, since all behave the same.
    Other settings with the same Whites and Levels (well Tone Curve) make images all black. I don't have a screen for those. But if in Tone Curve I have a negative setting an all sliders and with a positive in Whites +1, I get a black image.
    Some other stuff.
    I get the idea to combine Highlights with Shadows and Whites with Blacks, but still this is not natural. They should be in the normal order.
    And maybe on a scroll wheel value could be selected as 1, not as 5 like it is now.  5 is way too much for fine adjustments. If I want more, I can drag it.
    With my files in 2012 there is a problem in keeping the original color. Tone in general makes some tint changes on all images. They tend to go on the warm side of the world.
    These are the main important things in LR for me. If Tone is not working, that other stuff does not matter. A RAW file will always need adjustments.
    Thank you for your time.

    The huge jump in visual appearance when nudging Whites (e.g., from 0 to -1) is a bug and will be fixed.

  • C300 Red Frames and other experiences with 2014

    Hello,
    Just incase it's helpful, I'm sharing my experiences with Premiere 2014, C300 footage and a few other things.  First about me.  I have a small studio with two new mac mini's and one macbook bro running CC.  We recently bought a C300 and upgraded to 2014. 
    We've only had one project started and finished with C300.  Red frames and crashing were a constant problem.   We muscled through it.  Restart, Disk Permissions repair, PRAM,  bow to the east.
    Our next c300 project we just started.  I only have two interviews so far.  In 2014, one interview has red frames in it for about 10 of the 35 minutes.  After reading a bunch here I started a new 2014 project, imported that interview via the media browser and still got red frames. 
    Just for giggles, I opened up the previous version of premiere,  CC,  on the same machine, started a new project and imported the clip via the media browser.  There are NO red frames in the interview.  The only difference is the version of Premiere.  Same drive, same media, same mac.
    Most old projects the I've upgraded to 2014 crash constantly.  These consist of ProRes footage from an Atomos Ninja.  I've deleted my media cache on all my machines.  This problem has been pretty consistent. 
    For now, I'm going to work in CC.  On another thread, I hear there's a 2014 update on the way.  We'll see. 
    Good luck!
    J

    " ... bow to the east ... "
    lol ...
    We used to use that phrase a lot when I was younger and a problem that was intermittent popped up in something that we at times seemed to "solve", until ... it wasn't. At times, it does seem rather appropriate mostly jesting comment doesn't it?
    Neil

  • My old computer got stolen, how can I sync to a new itunes without losing all my contacts, and other stuff?

    So my old windows computer that my iphone was sync to got stolen, I bought a new MacBook Pro and it asking me to erase and sync What can I do to keep all my contacts, photos, and other data and sync my iphone then restore all my data? or anything similar you might think that could help. Please any information or tips will be helpful!

    The right way is to restore the backup that you kept of your old computer onto your new one. If it is too late for that before you do anything set up a backup process for the new one so when it crashes (note I said "when", not "if") you won't be faced with this problem again.
    In lieu of that the apps already mentioned will help you get content off the phone if it was not purchased from iTunes. But it it WAS purchased from iTunes just connect the phone to your new computer, Authorize iTunes on the new computer and choose "Transfer Purchases" from the iTunes file menu.

  • Things to know before building a Mega 651 (and other things you should know afte

    Okay, following hot on the heels of the "things to know" series on Mega 180 and 865, I thought I'd just chip in with this short post on what you should know before splashing out on a nice budget Mega 651
    PROCESSOR SUPPORT:
    The official list of supported CPUs can be found here:
    http://www.msi.com.tw/program/products/slim_pc/slm/pro_slm_cpu_support_detail.php?UID=431&kind=4
    Basically the ageing SiS651 chipset does not support Celeron / P4 cpus above 533mhz, and does NOT support the newer "Prescott" core cpus
    Celeron > 400Mhz FSB
    P4 Northwood > 533mhz FSB (512kb L2 cache)
    MEMORY:
    Basically to add to what is listed in the 865 "things to know"; from my own experience of using MSI motherboards in the past, ALWAYS use good quality branded memory, as using cheaper "generic" types inevitably leads to major problems. I know for a fact that Crucial, Kingston and Samsung types work well in MSI motherboards, and you should be okay with other high-end brands like Corsair and Geil.
    DRIVERS:
    DON'T bother using MSI LiveUpdate! The drivers provided on the cd supplied will work, but if you wish to download the latest drivers, you will find them here:
    http://download.sis.com/
    Download and install the:
    Chipset Software > SiS AGP (Gart) Driver
    IGP Graphics Drivers > SiS650 and 740 series
    http://www.realtek.com.tw/downloads/dlac97-2.aspx?lineid=5&famid=12&series=8&Software=True
    for Realtek AC97 Audio drivers
    http://www.realtek.com.tw/downloads/downloads1-3.aspx?lineid=1&famid=3&series=16&Software=True
    For Realtek Onboard Network interface
    The modem drivers supplied on the CD should work, I really don't know much about them as I have never used them (sorry). Failing that, if you are connected to the internet, Windows Update should be able to find them for you.
    OPERATING SYSTEM SUPPORT
    MSI state that only Windows XP is supported on Mega 651 (and other Mega barebones). Other versions of Windows (98, ME, 2000) will work provided you have drivers for hardware devices, all of which are provided on the install CD or from the links supplied above.
    You'll find that earlier versions of Windows won't have the drivers for the built-in card reader, so you may have to do a "google" search to get them. On my Mega 651, they are listed in Device Manager as "OEI-USB" devices.
    If you haven't already got Windows XP then I suggest you consider upgrading at the earliest opportunity; Microsoft themselves no longer support Win 98 / ME and most new software is being designed to work only with Windows XP
    Please note that MSI do NOT supply or support drivers for Linux; if you wish to attempt to install Linux on a Mega 651 (or other Mega PC model) you will need to obtain drivers yourself. The remote and LCD display functions will also not be available under Linux, unless some clever bod has developed drivers to do so.
    MEGA RADIO AND LCD DISPLAY:
    Download the Mega LiveUpdate for Mega 651 from here:
    http://www.msi.com.tw/program/support/software/swr/spt_swr_detail.php?UID=431&kind=4
    This will update your MEGA Radio program, update the BlueBird HIFi module firmware and allow you to set a "greeting" displayed on the LCD display when you switch on HiFi mode. Apart from that the LCD display serves NO other purpose in PC mode.
    After updating the firmware, you should power off your Mega 651, unplug the mains power cord for a few seconds then reconnect and restart for changes to take place.
    OTHER MSI SOFTWARE:
    If you REALLY must try out MSI Media Center III, it does work on the Mega 651, but I don't think the remote will work correctly.
    Although PCAlert 4 has been reported to work on the Mega 651 - having read the numerous problems most users have, I don't advise installing it. If you do get it to work correctly, unlike on the Mega 180 and 865, it will not display temps or fan speeds on the LCD display, as this feature only works on the 180 and 865, as they use diferent LCD displays.
    EXPANSION CARDS:
    Same as with other Megas, you get 1 AGP and 1 PCI slot.
    The AGP slot only supports up to 4x cards; a faster card will work, but only at 4x.
    Space is limited, if you decide to fit a PCI TV tuner card, you will be limited as to which AGP card you can fit. A full length card is probably not recommended, and a model with a slimline (or even passive) heatsink would be best.
    A better alternative would be to go for a VGA card with built in TV tuner, such as MSI TV5200-VTDF128 or an ATI Radeon All-In-Wonder card (ATI AIW is supported in WinXP MCE05)
    ON-BOARD VGA
    The SiS651 chipset is pretty old now, and the on-board SiS650 VGA is not up to playing any of the latest games, as it is only DirectX 7.0 compliant and does not support Hardware Texture & Lighting. However, it is adequate for playing back DVDs as it supports hardware acceleration (in PowerDVD for example), and general video output is decent. The maximum shared video memory size is 64mb.
    The Mega 651 does NOT feature TV-out as standard. You can however either buy an AGP video card which includes TV-out feature, or the Mega TV-out card (availble in UK from www.dabs.com). Please note, this card is ONLY for Mega 651, and does NOT work with the 865 model. (The 180 does however, thanks to nforce2 chipset, support TV-out as standard)
    ON-BOARD AUDIO
    The Realtek ALC650 AC97 audio codec offers 5.1 surround sound (with suitable speakers of course  ) as well as SP-DIF for digital output.
    The sound quality is quite reasonable; i'm currently listening to MP3s through a set of Creative Inspire 5.1 speakers, and its certainly good enough for me.
    There are three audio connectors on the rear, they default to:
    GREEN - Front speakers
    BLUE - Line In
    PINK - Mic
    To connect surround sound speakers correctly, you need to use the Realtek audio configuration tool (located in the Taskbar by the clock). Set the speaker config to 4 or 6 channel (5.1) and then click on the boxes to the right to configure the rear ports correctly
    GREEN - Front speakers
    BLUE - Rear Speakers
    PINK - Subwoofer / Centre Speaker
    NOTE: If you do decide you want to install a PCI soundcard, be aware that you will lose the Radio function in PC mode, and for audio output in Hi-Fi mode you will need to reconnect audio plugs from your soundcard to onboard sockets. The Hi-Fi mode and Radio only work with the onboard audio.
    POWER SUPPLY
    All the Mega series barebones come with a 200w PSU. Don't even think about upgrading to a higher output type, as the Mega PSU is a non-standard type. A standard ATX PSU will NOT physically fit inside the Mega case. Besides which, the Mega series have a special connector which powers the Bluebird hi-fi module and on-board sound when the PC is off. And there is a special Molex power connector for the CD/DVD drive, also for that to be used when PC is off.
    WINDOWS XP MCE 2005
    Media Center 2005 requires a DirectX 8.1 / 9.0 compliant video card with a minimum of 64mb RAM, 128mb RAM is recommended, however, for best performance. So you will need an AGP card, because SiS do not provide any MCE-compatible drivers. The TV@anywhere TV tuner (MS8606-10) and Mega TV Tuner (MS8606-40) are not supported by MCE05, because MCE2005 requires a TV card that will provide a direct MPEG2 stream, which a PVR card such as the Hauppage PVR MCE series can do (as a hardware card, MSIs card are software only and rely on drivers to do MPEG encoding), or a dedicated DVB-T card which receives an MPEG2 signal over the air.
    MEGA 651 REMOTE
    If you fit an MSI TV@anywhere card to your Mega 651, the Mega remote can be used to control the MSIPVS software, providing you use the remote receiver supplied with the TV@nywhere card. The Mega remote is designed to work natively with the MSI Media Center, and MSI Mega Radio programs only.
    If you wish to program the remote to operate other programs within windows, then you will need a program called Girder, and the accompanying MSI plugin, kindly provided by nathan. please see his sticky thread for more info, about his plugin, and how to obtain Girder.
    BROKEN HEATSINK MOUNTING CLIPS
    https://forum-en.msi.com/index.php?topic=96148.0
    Phew, thats about it. If any other Mega 651 users think I've missed anything out, please feel free to tell me.
    For other general hints and tips, look through the "things to know" posts regarding the 865 and 180.
    MEGA 651 =

    Quote
    PROCESSOR SUPPORT:
    The official list of supported CPUs can be found here:
    http://www.msi.com.tw/program/products/slim_pc/slm/pro_slm_cpu_support_detail.php?UID=431&kind=4
    Basically the ageing SiS651 chipset does not support Celeron / P4 cpus above 533mhz, and does NOT support the newer "Prescott" core cpus
    Celeron > 400Mhz FSB
    P4 Northwood > 533mhz FSB (512kb L2 cache)
    your processor is not supported. please start a new thread if you need help

Maybe you are looking for

  • Creative Cloud App not working / nothing shows up

    I think the image shows much of my problem. I start the creative cloud app, but nothing shows up. Therefor I cannot install/update anything anymore. Re-install did not fix this issue. Using Win8. Anybody has a clue?

  • How do I add column headings to an output file?

    Hi, I have an internal table that is created in my program and I send that table out as a data file attachment on an email. I have a request to include column heading on the data file going out.  Does anyone have any ideas as to how I can include a h

  • Reading data From XML file and setting into ViewObject to Pouplate ADF UI

    Hi, I have following requirement. I would like to read data from XML file and populate the data in ViewObject so that the data can be displayed in the ADF UI. Also when user modifies the data in the ADF UI, it should be modified back into to ViewObje

  • Distribution Point migration status in CM12 console

    Hi, We are using sccm 2012 r2 cu2. we are in middle of migration. We have in sccm 2007 under secondary site server name assd1 it contain MP and DP role. Under ASSd1 server i was created one of the distribution point server and copied all the package

  • I have windows 8...and want a compatible Photoshop Elements

    I just bought a new laptop with Windows 8.....I need a cheaper older version of Photoshop Elements compatible with this....I have been using Elements 7, but no longer have this .............Also what version of Lightroom is compatible with windows 8?