aspose file tools*
The moose likes Beginning Java and the fly likes run() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "run()" Watch "run()" New topic
Author

run()

Jon Camilleri
Ranch Hand

Joined: Apr 25, 2008
Posts: 660

Documentation does not seem to include the following call option to run:


Is this a bug or am I overlooking something?



Code sourced from here.


Jon
Anuj Prashar
Ranch Hand

Joined: Apr 15, 2008
Posts: 99

There is no such method in java.lang.Runnable. In the code it is not calling run() method from java.lang.Runnable instead it is calling user created static method also named run.


SCJP 5,SCWCD 5, RHCT
Wim Vanni
Ranch Hand

Joined: Apr 06, 2011
Posts: 96

The code you're referring to is not an implementation of the Runnable interface. The width and height arguments are there to set the size of a JFrame.

Cheers
Wim
Jon Camilleri
Ranch Hand

Joined: Apr 25, 2008
Posts: 660

Wim Vanni wrote:The code you're referring to is not an implementation of the Runnable interface. The width and height arguments are there to set the size of a JFrame.

Cheers
Wim


I did not see any run documented under methods at http://download.oracle.com/javase/6/docs/api/javax/swing/JFrame.html, so how do you know?
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14149
    
  18

Looking at the source code you pointed to, you can see that the run(JFrame frame, int width, int height) method is defined immediately under the main method.

That run() method here does not have anything to do with Runnable or JFrame or any other class in the standard library. It's just a normal method in the FileChooserTest class of the example.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: run()