Campbell Ritchie wrote:The method's documentation and the link therein both say when that method is called. But who is interested in an AWT method any more?
Paul Clapham wrote:
Gourav Das wrote:Is this true? Because i cannot find any such mention in the Oracle Docs that the function is called by JVM at runtime.
The documentation is there to tell you what the methods do. It's not there to explain how they are used by other code. However if you read any good tutorial about Swing it will certainly tell you that.
Have you read any tutorials? Swing is really really hard to learn by trying random things to see what works.
Tim Moores wrote:In Java, all classes implicitly extend Object, whether it is also explicitly specified or not. So that does not mean anything.
Try extending a class you created, or some other API class.
Carey Brown wrote:Because 'objectObj' is not a subclass of Object, it is an instance of Object.
Paul Clapham wrote:So just to confirm -- you are pressing the Ctrl key and some alphabetic key and clicking with the mouse on the button? Did you try finding out what alphabetic key was pressed at the same time?
I've never tried that and I wouldn't have expected to get key-press information when you click on a button. Apparently what I expected was correct.
I would expect that if you wrote a KeyListener then you would get the information you're looking for. But in real life, users don't expect clicking on a button in a GUI to be affected by what keys you happen to be pressing at the time.
Paul Clapham wrote:And what key did you press (apart from the Ctrl key) to cause that ActionEvent?
Dave Tolls wrote:What command are you using to run it, and is your compiled class file in the stopwatch_package folder?
Miroslav Lehotsky wrote:Fully qualified name of your class which you want to run is 'stopwatch_package.StopwatchApplication'. You need to provide in order to run it: And since you're running program without specifying -classpath (default classpath is therefore current directory), you need to run that command ('java stopwatch_package.StopwatchApplication') from parent directory of directory stopwatch_package. Are you running it from such place ?
Based on your picture, in order to run above mentioned command successfully, you should have following directory structure:
: your classpath is pointing to current directory, if you don't have defined environment variable "CLASSPATH" to some other value