Gourav Das

Greenhorn
+ Follow
since Mar 17, 2020
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
25
Given in last 30 days
25
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Gourav Das

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?



i know awt is old and not used , but its quite fun actually to learn it ,by learning it i am able to understand how JFrame inherits Frame and what Frame actually does... it helps me clearly see the big picture.. otherwise a beginner like me is always confused
1 week ago

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.



can you please suggest me a good swing tutorial? All i am doing is just learning from the Docs and trying to find out what each method does/....
1 week ago
So i have read from the book , that the methodis automatically called by the JVM if we override it after extending it from Frame class...

Is this true? Because i cannot find any such mention in the Oracle Docs that the function is called by JVM at runtime..

For Example , i have written a very simple application where i have not called paint() method by any object , still i can see , that it was called....

So please help me , on this

1 week ago
When im calling jFrame.setVisible(true) from the Constructor DateApplication() {} , it is showing unreachable code,  i have inherited the JFrame class so why is then showing this error?
1 week ago

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.



Is there any way to access the method outside of the Object class maybe in some other package.? Please illustrate.. im a beginner
1 week ago

Carey Brown wrote:Because 'objectObj' is not a subclass of Object, it is an instance of Object.



But i am extending DateTest class to inherit Object class , then Object objectObj should be able to see protected members since it is in the sub class although different package , i don't understand ...
1 week ago
I know that which is a method of java.lang.Object class....

But since protected members (either fields/methods) can be accessed in different packages sub classes , then the following code should work , but it throws an error , please tell me why.




The error is :

1 week ago
What does the Toolkit class do ? Furthermore in the Toolkit class , what does the function  used for?
1 week ago

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.




Actually  , i just was playing around with the CTRL_MASK , after reading the docs ... Can you please tell me what it is used for?

Herer are the several fields in ActionEvent Class..
1 week ago

Paul Clapham wrote:And what key did you press (apart from the Ctrl key) to cause that ActionEvent?




every other key , 'x','y','a', etc.. , still every time the result is 2 which is printed out in the console.... the key is pressed when i click on the "Button Exit"... :(

1 week ago
Can someone please tell me what the CTRL_MASK does , i read from the docs that its a control modifier .. and when i try to print it out using  System.out.println(ActionEvent.CTRL_MASK) while holding ctrl key , it results in 2 , and when not pressing control key , its still 2.

I have written a program ,,, here's the code , line 93 shows it

1 week ago

Dave Tolls wrote:What command are you using to run it, and is your compiled class file in the stopwatch_package folder?



Thank you
1 week ago

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:
[edit]: your classpath is pointing to current directory, if you don't have defined environment variable "CLASSPATH" to some other value




Thank you , i forgot to put the file i package folder , it works now ... yeah!!
1 week ago
I'm trying to make a stopwatch application in java , but its throwing an error like shown in the picture..


Here's the code





 .... please help
1 week ago