Thursday, October 25, 2012

Code used in video "Java prog#8. How to close previous jframe on the opening of new jframe in netbeans"

HERE I AM PROVIDING THE downloadable CODE LINK OF  THE JAVA CODE I HAVE USED IN THE VIDEO  "JJava prog#8. How to close previous jframe on the opening of new jframe in netbeans"  OF MY YOUTUBE CHANNEL PROGRAMMINGKNOWLEDGE

Click Link to watch the video LINK

This code below is for the close() function





   public void close(){

 WindowEvent winClosingEvent = new WindowEvent(this,WindowEvent.WINDOW_CLOSING);
 Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(winClosingEvent);

 }

after that you have to call the function using below code


rs.close();
      pst.close();
       close();
//Employee_info  is the frame name you want to open
        Employee_info s =new Employee_info();
       s.setVisible(true);

Other way of doing that is also

frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);


Java prog#8. How to close previous jframe on the opening of new jframe in netbeans





it's simple just follow the below code:
First import these two files below
import java.awt.event.*;
import java.awt.*;


then write the method for close

 public void close(){

 WindowEvent winClosingEvent = new WindowEvent(this,WindowEvent.WINDOW_CLOSING);
 Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent(winClosingEvent);

 }



Java prog#25.Exit Command Button jFrame in Java netbeans 




--------------------------------------------------------------------------------------------------------

Java: How do I close a JFrame while opening another one?
How to close a jframe without closing the main program
Close one JFrame without closing another?
passing data from one jframe to another
How to disable main JFrame when open new JFrame
Opening new JFrame replaces current window
NetBeans Forums - Opening new Jframe in existing window
iit Learn     java netbeans
java tutorial netbeans


How to close a Java Swing application from the code
swing - How do I close a java application from the code
java swing close window
How to close Java program or Swing Application with Example
Closing A Swing Application?
How to close this window? Swing
IT Certification Category (English)640x480

Partner Sites

VideoToGifs.com

EasyOnlineConverter.com

SqliteTutorials.com


Top Online Courses From ProgrammingKnowledge

Python Course http://bit.ly/2vsuMaS
Java Coursehttp://bit.ly/2GEfQMf
Bash Coursehttp://bit.ly/2DBVF0C
Linux Coursehttp://bit.ly/2IXuil0
C Course http://bit.ly/2GQCiD1
C++ Coursehttp://bit.ly/2V4oEVJ
PHP Coursehttp://bit.ly/2XP71WH
Android Coursehttp://bit.ly/2UHih5H
C# Coursehttp://bit.ly/2Vr7HEl
JavaFx Coursehttp://bit.ly/2XMvZWA
NodeJs Coursehttp://bit.ly/2GPg7gA
Jenkins Course http://bit.ly/2Wd4l4W
Scala Coursehttp://bit.ly/2PysyA4
Bootstrap Coursehttp://bit.ly/2DFQ2yC
MongoDB Coursehttp://bit.ly/2LaCJfP
QT C++ GUI Coursehttp://bit.ly/2vwqHSZ