Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Passing parameters to init() method  RSS feed

 
Mary Taylor
Ranch Hand
Posts: 327
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm converting an applet to an application and need to pass foreground and background colors to the init() method. Suggestions welcome.
I have created another applet which does not require parameters passed to it and am getting the same message, "Call arguments missing" to the init() method.
[This message has been edited by Betty Schwartz (edited May 30, 2001).]
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Betty,
I'm not sure what you are doing ... but to convert an applet to an application you usually replace the init method with a constructor (same name as class). Then you create a main method that calls the constructor and sends in the information. If you want to do it from the command line then you can have the main method pass them to the constructor.

Regards,
Manfred.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!