Marcus,
Thank you very much for your interest. I was just taking the pen (hmm, no,
the keyboard) to write you a reply. I tried too the suggestion of Surya
Duggirala on my jdk 1.1.5v7 for linux i386, and it didn't work either. I
didn't receive any other suggestion. At present, what I am doing is to
avoid extending inner classes (if I have two similar inner classes, instead
of defining a common ancestor I code them both fully).
Best regards,
Daniele

----------
> Da: Marcus Johnson <[EMAIL PROTECTED]>
> A: Daniele Lugli <[EMAIL PROTECTED]>
> Cc: [EMAIL PROTECTED]
> Oggetto: Re: Problem extending an inner class
> Data: marted́ 16 giugno 1998 16.22
> 
> Daniele,
> 
> I got a chance to try this suggestion.  The suggester says it worked for
> him, but it didn't work for me on my Win95 machine running Sun's JDK
1.1.5
> .  Have you come up with anything further?
> 
> Marcus
> 
> 
> On Mon, 15 Jun 1998, Marcus Johnson wrote:
> 
> > Daniele,
> > 
> > I shared this problem on another Java forum and here's the first answer
I
> > got.  I haven't had a chance to try out the suggestion, but here it is:
> > 
> > Posted by Surya Duggirala <[EMAIL PROTECTED]> on June 15, 1998 at 16:19:12:
> > 
> > In Reply to: Problem extending inner classes 
> > 
> > In the actionPerformed(ActionEvent) method of Dialog1 class, call
> > dispose() method after System.out.println(). Then the code will work
> > properly.
> > 
> > Surya
> > 
> > 
> > On Wed, 17 Apr 1996, Daniele Lugli wrote:
> > 
> > > Could somebody try the following application? It raises a null
pointer
> > > exception when class Dialog2, extending class Dialog1, tries to
access a
> > > data member of the outer class.
> > > Please consider that I am really a java newbie (about 10 days of
> > > programming) so I'm not saying I've found a bug, the problem is
probably
> > > mine.
> > > 
> > > Thank you,
> > > Daniele Lugli
> > > 
> > > 
> > > // File name: Wrong.java
> > > 
> > > import java.awt.*;
> > > import java.awt.event.*;
> > > import java.lang.String;
> > > import java.text.*;
> > > import java.util.*;
> > > 
> > > public class Wrong extends Frame {
> > > 
> > >   public static void main (String args[]) throws Exception {
> > >     new Wrong ();
> > >   }
> > > 
> > >   public Wrong () throws Exception {
> > >     super ();
> > >     setBounds (300, 100, 300, 100);
> > >     setVisible (true);
> > > 
> > >     i = 5;
> > > 
> > >     new Dialog2 (this);
> > >   }
> > > 
> > >   private void quit () {
> > >     setVisible (false);
> > >     dispose ();
> > >     System.exit (0);
> > >   }
> > > 
> > > 
> > >   class Dialog1 extends Dialog implements ActionListener {
> > >     Dialog1 (Frame parent) {
> > >       super (parent, "Dialog", true );
> > >       setBounds (400, 200, 100, 75);
> > >       okButton = new Button ("OK");
> > >       okButton.addActionListener (this);
> > >       add (okButton);
> > >       setVisible (true);
> > >     }
> > >     public void actionPerformed (ActionEvent aevt) {
> > >       
> > >       System.out.println ("Dialog1: i=" + i);
> > > 
> > >     }
> > >     private Button okButton;
> > >   }
> > > 
> > >   class Dialog2 extends Dialog1 {
> > >     Dialog2 (Frame parent) {
> > >       super (parent);
> > >     }
> > >     public void actionPerformed (ActionEvent aevt) {
> > >       super.actionPerformed (aevt);
> > >       
> > >       System.out.println ("Dialog2: i=" + i);
> > > 
> > >       quit ();
> > >     }
> > >   }
> > > 
> > >   int i;
> > > 
> > > }
> > > 
> > 
> > 

Reply via email to