I understand what what you recommended I do: create a class whose constructor class the constructor of another class using the object created by the first constructor call as an argument to create an...
Type: Posts; User: mjpam
I understand what what you recommended I do: create a class whose constructor class the constructor of another class using the object created by the first constructor call as an argument to create an...
So is the applet actually throwing an exception when the code is commented out?
The problem that I am having is that, with the call to the Pushed constructor in the Buttons class commented out,...
Here are the exceptions that the applet throws:
java.lang.Exception: who called?
at Buttons.<init>(Buttons.java:20)
at...
I don't know and I can't copy and paste them here because they have been run off the window before I can stop the applet.
All I get is:
at Pushed.<init>(Pushed.java:7)
at...
I should have been more clear. I did see the recursion, but I was asking about why it was throwing exceptions and how I could get it to print the exceptions and their causes.
Can you show where to add the try/throw/catch blocks to get the stack trace to print?
I have modified my code like this:
import java.applet.*;
import java.awt.*;
/*
<applet code =...
I see it now: the documentation say the addActionListener() method must take an ActionListener argument.
I'm sorry that my understanding is torturously slow in coming. I think that part of my...
So why can't I add an ActionListener to a Button object inside the Buttons object?
I understand that I can't add the ActionListener to the Buttons buttons object because the class of which it is...
I'm confused because, in the past, I have been able to add ActionListeners to Button objects in Applet classes.
For instance the following code compiles and runs as desired:
import...
Not unless I implement the ActionListener interface on it.
When I implement ActionListener on Buttons and put buttons.addActionListener(buttons.button) in side the constructor in the Pushed class,...
A reference to a Pushed object?
How do I add an ActionListener to the Button object in the GUI if the Pushed object contains no Button objects?
Here are the compiler error I get when I try to compile:
Buttons.java with the Pushed object in line 12 of Buttons.java not commented out
.\Pushed.java:7: <identifier> expected
...
I'm trying to get these two classes to work together:
import java.applet.*;
import java.awt.*;
/*
<applet code = Buttons.java width = 100 height = 100> </applet>
*/