Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Gui conpiled but no display.  RSS feed

 
jide agboola
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is the code i have just wrote for currency conversion from Dollar to Naira, did not show anything despite the setVisile method.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your constructor should not be void :
 
Pradeep
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

your constructor contain void thats why u cant get desired result

bye
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16028
87
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In fact if you "make the constructor void", then it is not a constructor anymore, but just a regular method that happens to have the same name as the class. Since you then don't have a constructor anymore in the class, the compiler will automatically add a public constructor with no arguments that does nothing - so when you run the program, that constructor is called and nothing happens.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!