Marcus Rag

Greenhorn
+ Follow
since Dec 23, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Marcus Rag

Hello,

I have created a netbeans Java application with 2 jFrames (mainScreen, newCallout). In mainScreen, as a subcomponent, I have created another jFrame called searchScreen. The reason I have this as a subcomponent, is because it only allows one instance of searchScreen to run. mainScreen also has a button to open the searchScreen along with the actionPerformed method to open it. That works fine.

My problems is now that I want to access the actionPerformed method in mainScreen to open searchScreen from newCallout. The method is public, but it does not want to find it.

I know I have done this before, but I haven't done any programming in a while...

Thanks in advance
Marcus
14 years ago
I already have experimented...and it takes very long. I constantly get the error that the non-static method can not be referenced from a static contexted...
14 years ago
Thanks Rob,

but where in my code do I put this?

cheers
14 years ago
Hi there,

I am new to the forum, so I apologize for any daft moments :)

I searched for this topic and only got topic on disabling the maximize button, so here goes.

I need to set my jFrame (which is also my main class) to maximize in startup. To set it to be the same size as the screen is not good enough, because that means that someone might accidentally move it.

Any suggestions?

Thanks,
Marcus
14 years ago
Thank you for the kind welcome...SO happy to have found this place!!! :)

It's hard to explain over a message, so please bare with me...

I have two JFrame forms (winStart and winLogCall). winStart (which is the main window and is ALWAYS open, even if other JFrame forms are open), has a dialog which I need to access from winLogCall (which is only opened as the user needs it), but because calling this dialog is a static method, it causes an error. The way around this error is instantiating a winStart object, calling the dialog, using it, and then closing the winStart object I instatiated to save resources.

I suppose another question would be, how do I call components of an instatiated object (winStarts' dialog for example), from another instatiated object (winLogCall) without instatiating winStart everytime (remember that winStart is open all the time anyways).

I have tried making the dialog an independant JFrame form itself, but that did not eliminate the static to non-static method errors and again I would need to instatiate a whole bunch of those objects...

I don't understand that an instatiated object does not take memory...If it is instatiated, it exist and is stored in the memory, so that the program knows what's happening. Campbell, I am not contesting you here, I am just voicing how understand what is going on. I have very limited knowledge (I finished school 3 weeks ago) so most of what I am writing here, is new to me. We did a lot of concepts etc. at school, but the is still weird for me. Please explain, if you can, how JRE handles instatiated objects to avoid memory wasting, without having the running program "forget" what object exist.

cheers
14 years ago
Hi there,

I have a similar situation. However, I may call several instances of this object while my program is running. This will obviously lead to a waste of resources.

Once I have finished using ONE instance of this object, how do I completely clear it from the PC, so as to avoid wasting resources? Can I simply use "object.dispose();"?

The reason my object is so resource hungry, is because it is and entire JFrame class that needs to be instatiated everytime I need it.

Thank you.
14 years ago