Re: System.exit(0) AND this.dispose() Programming Software Development by JamesCherrill dispose() just gets rid of a swing object. If you have two windows and dispose() one of them, the other will still be there. System.exit() terminates the whole program and closes all its windows. Re: System.exit(0) AND this.dispose() Programming Software Development by kudresov dispose frees resources used by [B]class[/B] and exit forces all threads of the program to terminate immediately, common use if you get an error in your program and what to terminate it you use System.exit(-1), -1 indicates that some error occurred, if no error occurred that would be exit(0) Re: how to stop the closing window ... Programming Software Development by mKorbel dispose(), really nothing for JFrame (JDialog, JOptionPane or JWindow)'s lifecycle, … Re: how to reset the form Programming Software Development by sknake Dispose the form and re-instantiate it to the state defined by the contructor(s). However I am almost certain this is [b]not[/b] what you want so please clarify what you are doing, and what you would like to do. Re: How to free heap memory??? Programming Software Development by masijade dispose() after hiding. setVisisble(false) simply "hides" it, it does not "get rid of it". Re: Kill a process? Programming Software Development by Cameronsmith63 Dispose? I had a similar problem with interops and had to force a GC. Re: Dispose Programming Software Development by Cameronsmith63 … the function again, I get that problem. Im using base.Dispose(); to close the "Configuration". If i use that… command, shouldn't it dispose of everything in "Configuration"? Environment.Dispose(); would close the whole application though… Re: Dispose Programming Software Development by apegram … object you use implements the IDisposable interface and has a Dispose method, you want to be in the habit of using… by the compiler into a try/finally block that calls Dispose on the object. Example: [CODE] using (SaveFileDialog dialog = new SaveFileDialog…] By doing this, you will not need to explicitly call Dispose in your own code. Dispose Programming Software Development by Cameronsmith63 … some help with this. How long does it take to dispose of da and confdt? What im trying to say is… so that i can kill it everytime i need to dispose of it? Or do I need to force a Garbage… Re: Dispose Programming Software Development by Cameronsmith63 but I do close all of my elements with conn.Close(); conn.Dispose(); da.Dispose();. I test this with time periods and I see that it works after I wait a while when executing this, or it bombs out on my 3rd attempt at executing this... Re: Dispose Programming Software Development by Mike Askew …[0].DefaultCellStyle.Format = "G"; conn.Close(); da.Dispose(); //Try that conn.Dispose(); //Try that } [/CODE] You may have already done… Re: Dispose Programming Software Development by Mike Askew As a matter of good practice I would manually dispose of the elements after each use, not relying on a garbage collection then and should hopefully resolve the error. Re: Dispose Programming Software Development by Mike Askew It is strange indeed, calling the .Dispose() method is the garbage cleaner for the two variables we call it on so it should work. Stumps me at this point tbh. Yeah could give it a shot using a .txt though you can also open and edit csv's in notepad :P? Re: Dispose Programming Software Development by skatamatic … and unless performance or memory consumption is an issue calling .Dispose() will just clutter your code. Dispose Programming Software Development by bbman …: private void function() { SaveFileDialog x = new SaveFileDialog; ... } Now, should I dispose of it at the end, or will it do it… Re: Dispose in asp.net Programming Software Development by IdanS …object any more, and sugesting him to dispose the object, you cant force the Garbage Collection…"he thinks" that its ready to dispose the object. Its not like in c++ that… you could dispose the object manually when ever that you wanted!…As for "null" you dont either dispose the object, the only thing that you do is… Re: Dispose in asp.net Programming Software Development by sknake …When you do: [CODE]cmd.Dispose();[/CODE] you are not really dispose the object the minute that you…object any more, and sugesting him to dispose the object, you cant force the Garbage …quot;he thinks" that its ready to dispose the object. Its not like in c++ that…As for "null" you dont either dispose the object, the only thing that you do… Dispose...bleh Programming Software Development by Cameronsmith63 …override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing);… through, when it gets to components.Dispose(), it goes to private void TerminalStatus_SelectedIndexChanged(… Dispose/hide the JFrame on a click-event Programming Software Development by eranga262154 Hi all, I want to dispose a JFrame using a click-event. So I simply do … work. Do you have any idea. I just want to dispose all the visible JFrames. Actually I have only one JFrame… exceptions either on it. And also I just want to dispose, not to exit the application. Any idea? Re: Dispose in asp.net Programming Software Development by sknake ….NonPublic | BindingFlags.InvokeMethod; MethodInfo mi = typeof(SqlCommand).GetMethod("Dispose", bf); mi.Invoke(cmd, new object[] { true });….InvokeMethod | BindingFlags.Public; MethodInfo mi = typeof(Component).GetMethod("Dispose", bf); mi.Invoke(cmd, null); cmd.CommandText = … Dispose a JFrame using JPanel Programming Software Development by kathmartir I have a problem with the dispose method. . .I got 3 java files with a class name: ….java. All of these works good until I put the dispose(); method on one of the condition. All I want is… opening the PageOne.java. I thought the use of method dispose(); would be same as using it in JFrame. Can you… Re: Dispose a JFrame using JPanel Programming Software Development by sincerelibran … Sincerelibran [QUOTE=kathmartir;1005922]I have a problem with the dispose method. . .I got 3 java files with a class name….java. All of these works good until I put the dispose(); method on one of the condition. All I want is… opening the PageOne.java. I thought the use of method dispose(); would be same as using it in JFrame. Can you… Re: Dispose a JFrame using JPanel Programming Software Development by javaAddict … could have been simpler. First don't use the "dispose" method. Second you need to close the the MainPage…); } } [/CODE] It is better to call dispose on the PageOne: [CODE] mp.setVisible(true); this.dispose(); [/CODE] Because you created it locally… Re: Dispose...bleh Programming Software Development by Cameronsmith63 Okay on the form is a combobox that binds data from a DB. If I dispose the combobox control, in the Dispose Method, then the app closes properly...but do i really need to add a line of code for that? It worked fine before - lol. Re: Dispose a JFrame using JPanel Programming Software Development by FriQenstein …figure out how to make JFrame2 hide or dispose when the checkbox is deselected/unchecked. I've…} else { if (evt.getStateChange() == ItemEvent.DESELECTED) { new DataDetectionFrame().dispose(); } } } public static void main(String args[]) { java.awt.… dispose (); ........not working ...... Programming Software Development by atul ….4 gives error for not having any such method for dispose(); if i have button b1 on my applet it shud… function : public void actionPerformed(ActionEvent e) { if (e.getSource()==b1) {dispose ();} } Re: Dispose/hide the JFrame on a click-event Programming Software Development by eranga262154 Sorry for disturbing. Simply I can do it by diposing by calling dispose() Dispose in asp.net Programming Software Development by srikanthkadem [code] SqlCommand cmd = new SqlCommand(); cmd.Dispose(); System.GC.Collect(); cmd.CommandText = ""; cmd.Dispose(); [/code] can please explain why this code is not showing error....... Re: Dispose in asp.net Programming Software Development by Ramy Mahrous … inherits from Component Component has this implmenetation of Dispose [code=C#] protected virtual void Dispose(bool disposing) { if (disposing) { lock (this) { if… Re: Dispose in asp.net Programming Software Development by Ramy Mahrous I knew it I knew it, YOU CAN'T call disposed explicit in your code, because to dispose the component your should by pass bool to true and the dispose method which has parameter (bool) is protected which means SqlCommand itself in specific time call it.