Results 1 to 8 of 8
- 08-18-2011, 01:54 AM #1
- 08-18-2011, 02:01 AM #2
Why would you want to do that?
- 08-18-2011, 02:06 AM #3
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,545
- Rep Power
- 11
Why? What are you trying to do?
I'm not sure that such a thing is possible. Even Constructor<T>'s newInstance() "uses the constructor represented by...". It is the job of constructors to construct, and other code relies on objects having been constructed properly.
- 08-18-2011, 02:26 AM #4
The constructor opens a window and I dont want the window to open twice but I still need to use the methods in that class. If there is a better way please tell me.
- 08-18-2011, 02:35 AM #5
What?
Constructors do not open windows unless you have added code to do that. If it it is not doing what you want then you need to fix the code so it does do what you want.
- 08-18-2011, 03:03 AM #6
Move the utility methods to a separate class from the GUI class.
- 08-18-2011, 04:09 AM #7
Member
- Join Date
- Aug 2011
- Posts
- 95
- Rep Power
- 0
It is quite impossible to create an instance without calling a constructor.
However, a class can have as many constructor methods as you want. This might help you accomplish what you want.
- 10-28-2011, 12:49 PM #8
Member
- Join Date
- Oct 2011
- Posts
- 3
- Rep Power
- 0
Similar Threads
-
constructor calling sequence.
By himanshu19 in forum New To JavaReplies: 1Last Post: 02-04-2010, 02:40 PM -
Calling a constructor from another one.
By Somelauw in forum New To JavaReplies: 1Last Post: 11-28-2009, 03:42 PM -
Constructor calling
By ravian in forum New To JavaReplies: 2Last Post: 12-22-2007, 06:53 PM -
Calling constructor of parent class from a constructor
By Java Tip in forum Java TipReplies: 0Last Post: 12-19-2007, 09:10 AM -
Calling constructor of same class from a constructor
By Java Tip in forum Java TipReplies: 0Last Post: 12-19-2007, 09:01 AM


2Likes
LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks