Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4059545

javac hangs with inner class code

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P3 P3
    • None
    • 1.2.0
    • tools
    • None
    • generic
    • solaris_2.5.1

      import java.awt.*;
      import java.awt.event.*;
       
      public class SelectDialog
              extends Dialog
      {
              private List l;
      // private SelResult res;
              private String[] choices;
       
              public SelectDialog( Frame parent, String title, String text,
                                      String[] choices/*, SelResult res */) {
                      super( parent, title, true);
      // this.res = res;
                      this.choices = choices;
                      if( choices == null) {
                              opKO();
                              return;
                      }
      // add( "North", new MultiLabel( text));
       
                      add( "Center", l = new LocalList());
       
                      addWindowListener(
                              new WindowAdapter() {
                                  public void windowClosing( WindowEvent event) {
                                              opKO();
                                      }
                              } );
       
                      Panel p = new Panel();
                      p.setLayout(new FlowLayout(FlowLayout.CENTER));
                      Button b = new Button("OK");
                      b.addActionListener(
                              new ActionListener() {
                                  public void actionPerformed( ActionEvent event) {
                                              opOK();
                                      }
                              } );
              p.add(b);
                      Button b2= new Button("Cancel");
                      b.addActionListener(
                              new ActionListener() {
                                  public void actionPerformed( ActionEvent event) {
                                              opKO();
                                      }
                              } );
              p.add(b2);
              add("South", p);
       
       
                      pack();
                      show();
              }
       
              private void opOK() {
      // res.pos = l.getSelectedIndex();
      // res.value = ( res.pos == -1) ? null : choices[res.pos];
                      dispose();
              }
       
              private void opKO() {
      // res.value = null;
      // res.pos = -1;
                      dispose();
              }
       
              class LocalList
                      extends List
              {
                      public LocalList() {
                              setMultipleMode( false);
                              for( int i = 0; i < choices.length; i++)
                                      add( choices[i]);
                              addActionListener(
                                      new ActionListener() {
                                          public void actionPerformed(ActionEvent event) {
                                                      opOK();
                                              }
                                      } );
                      }
              }
       
      }

            wmaddoxsunw William Maddox (Inactive)
            dstoutamsunw David Stoutamire (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: