File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

run()

 
Jon Camilleri
Ranch Hand
Posts: 664
Chrome Eclipse IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Anuj Prashar
Ranch Hand
Posts: 99
Android Java Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Wim Vanni
Ranch Hand
Posts: 96
Eclipse IDE Java Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 664
Chrome Eclipse IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 15150
31
Android IntelliJ IDE Java Scala Spring
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic