This document contains source code for a college student management system created in Java. It includes the source code for the home page class, which defines the main GUI containing buttons to add, delete, search for, and update student details. It also displays source code for other classes like the search page class, which allows the user to search for a student by ID and displays the results in a table. The project aims to simplify tasks like adding, editing, and deleting student information over time.
This document contains code for a login form and main interface for a grain management application. The login form allows users to enter credentials which are validated against hardcoded values. If valid, it opens the main interface containing buttons for various application functions. The interface is initialized by calling initComponents() which sets up the layout and UI elements.
The document describes three Java programs for calculating simple mathematical operations and values:
1. A calculator program that allows users to enter two numbers and select a mathematical operation (addition, subtraction, multiplication, or division) to perform the calculation.
2. A program that calculates severance pay values based on a user's time of service and monthly salary.
3. A program that provides budget estimates for different construction/remodeling jobs based on area size and material selections.
This document contains Java code for a student portal application. It defines a StudentDetailsForm class that initializes a GUI with labels, text fields, buttons etc to allow entry of student details like name, ID, date of birth, address etc. It connects to an Oracle database and includes methods for submitting the student details to a database table on button click, and refreshing the form fields.
The document discusses using annotations in Java, providing examples of annotations for servlets, EJBs, web services, CDI, and using frameworks like JUnit, Spring, Javassist, and ASM. It presents code samples to define servlets, session beans, RESTful and SOAP web services, and component injection using annotations instead of XML configurations. The document also demonstrates how to programmatically read annotation values and metadata using reflection, Javassist, and ASM.
The document discusses the steps to create a Java quiz application project using Java Swing and SQLite. It describes creating classes like AdminLogin, AdminPanel, Database, Question etc. to handle authentication, questions management and database operations. The project allows admins to add, delete and view questions and users, while users can attempt quizzes and view performance feedback.
This document discusses migrating from Swing to JavaFX. It presents 3 migration scenarios: 1) embedding JavaFX in Swing, 2) rewriting Swing apps without FXML, and 3) rewriting with FXML. Key similarities and differences between Swing and JavaFX concepts like buttons, layouts, and tables are outlined. FXML is described as a way to declaratively describe JavaFX scene graphs using XML. The document also briefly mentions tools like Scene Builder and concludes without covering advanced JavaFX topics like CSS, animation, and effects.
Slides accompanying a presentation on Dropwizard I gave at the DevIgnition conference ( www.devignition.com ) on April 29, 2016. The sample code is on GitHub at https://github.com/sleberknight/dropwizard-devignition-2016
Spring Framework Petclinic sample applicationAntoine Rey
Spring Petclinic is a sample application that has been designed to show how the Spring Framework can be used to build simple but powerful database-oriented applications.
The fork named Spring Framework Petclinic maintains a version both with a plain old Spring Framework configuration and a 3-layer architecture (i.e. presentation --> service --> repository).
This document contains code for a login form and main interface for a grain management application. The login form allows users to enter credentials which are validated against hardcoded values. If valid, it opens the main interface containing buttons for various application functions. The interface is initialized by calling initComponents() which sets up the layout and UI elements.
The document describes three Java programs for calculating simple mathematical operations and values:
1. A calculator program that allows users to enter two numbers and select a mathematical operation (addition, subtraction, multiplication, or division) to perform the calculation.
2. A program that calculates severance pay values based on a user's time of service and monthly salary.
3. A program that provides budget estimates for different construction/remodeling jobs based on area size and material selections.
This document contains Java code for a student portal application. It defines a StudentDetailsForm class that initializes a GUI with labels, text fields, buttons etc to allow entry of student details like name, ID, date of birth, address etc. It connects to an Oracle database and includes methods for submitting the student details to a database table on button click, and refreshing the form fields.
The document discusses using annotations in Java, providing examples of annotations for servlets, EJBs, web services, CDI, and using frameworks like JUnit, Spring, Javassist, and ASM. It presents code samples to define servlets, session beans, RESTful and SOAP web services, and component injection using annotations instead of XML configurations. The document also demonstrates how to programmatically read annotation values and metadata using reflection, Javassist, and ASM.
The document discusses the steps to create a Java quiz application project using Java Swing and SQLite. It describes creating classes like AdminLogin, AdminPanel, Database, Question etc. to handle authentication, questions management and database operations. The project allows admins to add, delete and view questions and users, while users can attempt quizzes and view performance feedback.
This document discusses migrating from Swing to JavaFX. It presents 3 migration scenarios: 1) embedding JavaFX in Swing, 2) rewriting Swing apps without FXML, and 3) rewriting with FXML. Key similarities and differences between Swing and JavaFX concepts like buttons, layouts, and tables are outlined. FXML is described as a way to declaratively describe JavaFX scene graphs using XML. The document also briefly mentions tools like Scene Builder and concludes without covering advanced JavaFX topics like CSS, animation, and effects.
Slides accompanying a presentation on Dropwizard I gave at the DevIgnition conference ( www.devignition.com ) on April 29, 2016. The sample code is on GitHub at https://github.com/sleberknight/dropwizard-devignition-2016
Spring Framework Petclinic sample applicationAntoine Rey
Spring Petclinic is a sample application that has been designed to show how the Spring Framework can be used to build simple but powerful database-oriented applications.
The fork named Spring Framework Petclinic maintains a version both with a plain old Spring Framework configuration and a 3-layer architecture (i.e. presentation --> service --> repository).
Java!!!!!Create a program that authenticates username and password.pdfarvindarora20042013
Java!!!!!
Create a program that authenticates username and password. The program should have a clear
and submit button. If you click sumbit it will go to a new JFrame. The new Jframe contain a
menu button( that does nothing) and a logout button that exits the program.
Solution
import java.sql.*;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import javax.swing.*;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Administrator
*/
public class Login extends javax.swing.JFrame {
/**
* Creates new form Login
*/
public Login() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings(\"unchecked\")
//
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
jLabel3 = new javax.swing.JLabel();
jPasswordField1 = new javax.swing.JPasswordField();
jButton1 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jLabel1.setFont(new java.awt.Font(\"Tahoma\", 1, 18)); // NOI18N
jLabel1.setText(\"Hiding Data Cloud \");
jLabel2.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N
jLabel2.setText(\"User Name : \");
jLabel3.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N
jLabel3.setText(\"Password :\");
jButton1.setText(\"Login\");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(96, 96, 96)
.addComponent(jLabel1))
.addGroup(layout.createSequentialGroup()
.addGap(69, 69, 69)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 134,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel3)
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jButton1)
.addComponent(jPasswordField1))))))
.addContainerGap(112, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(35, 35, 35)
.addComponent(jLabel1)
.addGap(53, 53, 53)
.addGroup(layout.creat.
This document provides an overview of the code for a Java Spring Security application. It includes descriptions and code snippets for key Spring Security classes like the WebSecurityConfig class that configures security, the SecureUserCredentialService class that implements authentication, and the User entity class. It also summarizes the purpose and relationships between classes for securing access to application routes, registering and authenticating users, and storing user credentials in a database.
JavaFX 8 est disponible depuis mars 2014 et apporte son lot de nouveautés. Gradle est en version 2 depuis juillet 2014. Deux technologies plus que prometteuses: JavaFX donne un coup de jeune au développement d’applications desktop en Java en apportant un navigateur web intégré, le support des WebSockets, de la 3D, et bien d’autres. Gradle est l’outil de d’automatisation de build à la mode, apportant de superbes possibilités par rapport rapport à maven, outil vieillissant, grâce à l’engouement de la communauté vis à vis de cet outil mais aussi par le fait de la technologie utilisée en son sein: groovy. Venez découvrir comment il est possible de réaliser rapidement une application à la mode en JavaFX avec un outil à la mode également. Bref venez à une session trendy.
This document discusses advanced JavaScript techniques. It covers object-oriented JavaScript concepts like references, function overloading, type checking, scopes, closures, object creation, and inheritance. It also discusses performance improvements like scope management, object caching, and optimizing DOM selection. Finally, it discusses debugging and testing JavaScript code as well as distributing JavaScript applications.
This document summarizes jQuery secrets presented by Bastian Feder. It discusses utilities like jQuery.data() and jQuery.removeData() for saving and removing state on DOM elements. It also covers AJAX settings, events, extending jQuery, and jQuery plugins. The presentation provides code examples for working with data, events, namespaces, AJAX, and extending jQuery functionality.
The document discusses dynamically generating view objects (VOs) and their definitions in Oracle Application Development Framework (ADF). It describes retrieving an entity definition, creating a VO definition by extending the ViewDefImpl class and setting properties. If a VO does not exist, the definition is used to create a new VO instance. Attribute definitions are added by retrieving attributes from the entity definition.
This document provides an overview and comparison of various Java web frameworks including JPA 2, MyBatis, Hibernate, Struts 2, Stripes, Spring MVC, Tapestry, Wicket, JSF 2, and GWT. Code examples are shown for implementing basic CRUD functionality using each framework. The frameworks are evaluated based on factors such as ease of use, query APIs, performance, portability, and community support.
Apache Wicket is constantly growing in popularity throughout all kinds of projects. However Wicket doesn't come out of the box with a built-in Java EE support. Integration to CDI is missing and the same is valid for Bean Validation support for example. This session demonstrates how you can user CDI, Conversations and Bean Validation together with Apache Wicket. The first part of the talk will consist of a small slide-driven theoretical part whereas the second part will consist of a coding session that demonstrates hands-on how to hook everything together.
In Java Write a GUI application to simulate writing out a check. The.pdfflashfashioncasualwe
In Java Write a GUI application to simulate writing out a check. The value of a check can be
between 0 – 999,999,999,999.99. Your application will accept a name and a value. And display
it on a check. As a minimum you will display the following information: Bank name Pay to the
order of Amount in words Comma separate amount. Your GUI does not have to be exactly as
shown but must have the information indicated above.
Solution
Class cheque is used to enter values
public class Cheque extends javax.swing.JFrame {
public Cheque() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings(\"unchecked\")
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
jTextField2 = new javax.swing.JTextField();
jButton1 = new javax.swing.JButton();
jLabel3 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jLabel1.setText(\"Name\");
jLabel2.setText(\"Amount\");
jButton1.setText(\"Submit\");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jLabel3.setText(\"Enter Values\");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(12, 12, 12)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jButton1)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel2)
.addGap(18, 18, 18)
.addComponent(jTextField2,
javax.swing.GroupLayout.PREFERRED_SIZE, 240,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE,
45, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTextField1,
javax.swing.GroupLayout.PREFERRED_SIZE, 240,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE,
206, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addGap(32, 32, 32)))
.addContainerGap(7, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 34,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addCo.
JavaServer Faces (JSF) is a web application framework that uses the model-view-controller (MVC) paradigm. It provides reusable UI components and manages the flow of web applications. MyFaces is an open source implementation of JSF that provides additional pre-built components. The document discusses the JSF architecture, how it works, example code components like input fields and validators, and advantages like reusable components and built-in validation.
The document discusses how to access a MySQL database from a Struts 2 application. It describes setting up the database with a table and data. It then covers creating a Struts 2 action class to query the database on user login, and JSP views for successful and failed logins. Configuration files including struts.xml and web.xml are provided to wire it all together.
This document provides an introduction to Spring Boot, including its objectives, key principles, and features. It discusses how Spring Boot enables building standalone, production-grade Spring applications with minimal configuration. It demonstrates creating a "Hello World" REST app with one Java class. It also covers auto-configuration, application configuration, testing, supported technologies, case studies, and other features like production readiness and remote shell access.
The document describes a project that provides online quizzes to test knowledge on various topics using database connectivity. It includes source code for login, registration, menu selection, quiz questions, and results display screens. The project uses Java Swing for the front-end and MySQL database to store user details, questions, answers, and test performance. It allows users to register, select a subject to test, attempt questions, view results, and retake tests.
The document discusses how JavaScript frameworks like MooTools can be leveraged in Joomla sites to provide features like DOM manipulation, classes, event listeners, and effects. It describes how MooTools is the default framework used by Joomla and provides examples of its key capabilities. Additionally, it offers suggestions for optimizing framework usage, such as implementing the Google Loader API to decrease page load times.
Service worker: discover the next web game changerSandro Paganotti
This talk aims to introduce the upcoming ServiceWorker technology, its basic functionalities, its lifecycle and its most common use cases. Then it moves to analyse in detail a less obvious implementation of this technology: how to create a wiki engine using ServiceWorker and IndexedDB.
Step By Step Guide For Buidling Simple Struts AppSyed Shahul
This document provides steps to build a simple Struts application, including creating forms, actions, configuration files, and JSP pages. The key steps are:
1. Set up the project directory structure and files like web.xml.
2. Define forms, actions, and mappings in struts-config.xml.
3. Create ActionForm classes to handle form fields and validation.
4. Write Action classes to process requests and select views.
5. Develop JSP pages to display forms and output using Struts tags.
6. Build, deploy and test the complete application.
This document provides an overview of Spring and Spring Boot frameworks. It discusses the history of Java and Spring, how Spring provides inversion of control and dependency injection. It also covers Spring MVC for web applications, Spring Data for data access, and how Spring Boot aims to simplify configuration. The document concludes with discussing some next steps including looking at Spring Security, Spring Cloud, and using Spring with other JVM languages.
This document summarizes some of the key enhancements between Java 6 and Java 7, including improved type inference for generics, new syntax for number and string literals, expanded exception handling with multi-catch and try-with-resources, and new concurrency utilities like the Fork/Join framework and NIO watch service. It also covers miscellaneous features like symbolic file links and method handles.
Avinash Kundaliya: Javascript and WordPresswpnepal
This document discusses JavaScript and how it is used on over 92% of websites. It covers JavaScript fundamentals like variable scope, hoisting, and the this keyword. It also discusses how JavaScript allows first-class functions and functional programming. The document then covers how to properly manage scripts in WordPress using functions like wp_register_script, wp_enqueue_script, and wp_localize_script to internationalize scripts. It concludes by mentioning additional JavaScript topics to explore like closures and functional programming.
How to Build a Module in Odoo 17 Using the Scaffold MethodCeline George
Odoo provides an option for creating a module by using a single line command. By using this command the user can make a whole structure of a module. It is very easy for a beginner to make a module. There is no need to make each file manually. This slide will show how to create a module using the scaffold method.
Java!!!!!Create a program that authenticates username and password.pdfarvindarora20042013
Java!!!!!
Create a program that authenticates username and password. The program should have a clear
and submit button. If you click sumbit it will go to a new JFrame. The new Jframe contain a
menu button( that does nothing) and a logout button that exits the program.
Solution
import java.sql.*;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import javax.swing.*;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Administrator
*/
public class Login extends javax.swing.JFrame {
/**
* Creates new form Login
*/
public Login() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings(\"unchecked\")
//
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
jLabel3 = new javax.swing.JLabel();
jPasswordField1 = new javax.swing.JPasswordField();
jButton1 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jLabel1.setFont(new java.awt.Font(\"Tahoma\", 1, 18)); // NOI18N
jLabel1.setText(\"Hiding Data Cloud \");
jLabel2.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N
jLabel2.setText(\"User Name : \");
jLabel3.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N
jLabel3.setText(\"Password :\");
jButton1.setText(\"Login\");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(96, 96, 96)
.addComponent(jLabel1))
.addGroup(layout.createSequentialGroup()
.addGap(69, 69, 69)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 134,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel3)
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jButton1)
.addComponent(jPasswordField1))))))
.addContainerGap(112, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(35, 35, 35)
.addComponent(jLabel1)
.addGap(53, 53, 53)
.addGroup(layout.creat.
This document provides an overview of the code for a Java Spring Security application. It includes descriptions and code snippets for key Spring Security classes like the WebSecurityConfig class that configures security, the SecureUserCredentialService class that implements authentication, and the User entity class. It also summarizes the purpose and relationships between classes for securing access to application routes, registering and authenticating users, and storing user credentials in a database.
JavaFX 8 est disponible depuis mars 2014 et apporte son lot de nouveautés. Gradle est en version 2 depuis juillet 2014. Deux technologies plus que prometteuses: JavaFX donne un coup de jeune au développement d’applications desktop en Java en apportant un navigateur web intégré, le support des WebSockets, de la 3D, et bien d’autres. Gradle est l’outil de d’automatisation de build à la mode, apportant de superbes possibilités par rapport rapport à maven, outil vieillissant, grâce à l’engouement de la communauté vis à vis de cet outil mais aussi par le fait de la technologie utilisée en son sein: groovy. Venez découvrir comment il est possible de réaliser rapidement une application à la mode en JavaFX avec un outil à la mode également. Bref venez à une session trendy.
This document discusses advanced JavaScript techniques. It covers object-oriented JavaScript concepts like references, function overloading, type checking, scopes, closures, object creation, and inheritance. It also discusses performance improvements like scope management, object caching, and optimizing DOM selection. Finally, it discusses debugging and testing JavaScript code as well as distributing JavaScript applications.
This document summarizes jQuery secrets presented by Bastian Feder. It discusses utilities like jQuery.data() and jQuery.removeData() for saving and removing state on DOM elements. It also covers AJAX settings, events, extending jQuery, and jQuery plugins. The presentation provides code examples for working with data, events, namespaces, AJAX, and extending jQuery functionality.
The document discusses dynamically generating view objects (VOs) and their definitions in Oracle Application Development Framework (ADF). It describes retrieving an entity definition, creating a VO definition by extending the ViewDefImpl class and setting properties. If a VO does not exist, the definition is used to create a new VO instance. Attribute definitions are added by retrieving attributes from the entity definition.
This document provides an overview and comparison of various Java web frameworks including JPA 2, MyBatis, Hibernate, Struts 2, Stripes, Spring MVC, Tapestry, Wicket, JSF 2, and GWT. Code examples are shown for implementing basic CRUD functionality using each framework. The frameworks are evaluated based on factors such as ease of use, query APIs, performance, portability, and community support.
Apache Wicket is constantly growing in popularity throughout all kinds of projects. However Wicket doesn't come out of the box with a built-in Java EE support. Integration to CDI is missing and the same is valid for Bean Validation support for example. This session demonstrates how you can user CDI, Conversations and Bean Validation together with Apache Wicket. The first part of the talk will consist of a small slide-driven theoretical part whereas the second part will consist of a coding session that demonstrates hands-on how to hook everything together.
In Java Write a GUI application to simulate writing out a check. The.pdfflashfashioncasualwe
In Java Write a GUI application to simulate writing out a check. The value of a check can be
between 0 – 999,999,999,999.99. Your application will accept a name and a value. And display
it on a check. As a minimum you will display the following information: Bank name Pay to the
order of Amount in words Comma separate amount. Your GUI does not have to be exactly as
shown but must have the information indicated above.
Solution
Class cheque is used to enter values
public class Cheque extends javax.swing.JFrame {
public Cheque() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings(\"unchecked\")
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
jTextField2 = new javax.swing.JTextField();
jButton1 = new javax.swing.JButton();
jLabel3 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jLabel1.setText(\"Name\");
jLabel2.setText(\"Amount\");
jButton1.setText(\"Submit\");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jLabel3.setText(\"Enter Values\");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(12, 12, 12)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(jButton1)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel2)
.addGap(18, 18, 18)
.addComponent(jTextField2,
javax.swing.GroupLayout.PREFERRED_SIZE, 240,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE,
45, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTextField1,
javax.swing.GroupLayout.PREFERRED_SIZE, 240,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE,
206, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addGap(32, 32, 32)))
.addContainerGap(7, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 34,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addCo.
JavaServer Faces (JSF) is a web application framework that uses the model-view-controller (MVC) paradigm. It provides reusable UI components and manages the flow of web applications. MyFaces is an open source implementation of JSF that provides additional pre-built components. The document discusses the JSF architecture, how it works, example code components like input fields and validators, and advantages like reusable components and built-in validation.
The document discusses how to access a MySQL database from a Struts 2 application. It describes setting up the database with a table and data. It then covers creating a Struts 2 action class to query the database on user login, and JSP views for successful and failed logins. Configuration files including struts.xml and web.xml are provided to wire it all together.
This document provides an introduction to Spring Boot, including its objectives, key principles, and features. It discusses how Spring Boot enables building standalone, production-grade Spring applications with minimal configuration. It demonstrates creating a "Hello World" REST app with one Java class. It also covers auto-configuration, application configuration, testing, supported technologies, case studies, and other features like production readiness and remote shell access.
The document describes a project that provides online quizzes to test knowledge on various topics using database connectivity. It includes source code for login, registration, menu selection, quiz questions, and results display screens. The project uses Java Swing for the front-end and MySQL database to store user details, questions, answers, and test performance. It allows users to register, select a subject to test, attempt questions, view results, and retake tests.
The document discusses how JavaScript frameworks like MooTools can be leveraged in Joomla sites to provide features like DOM manipulation, classes, event listeners, and effects. It describes how MooTools is the default framework used by Joomla and provides examples of its key capabilities. Additionally, it offers suggestions for optimizing framework usage, such as implementing the Google Loader API to decrease page load times.
Service worker: discover the next web game changerSandro Paganotti
This talk aims to introduce the upcoming ServiceWorker technology, its basic functionalities, its lifecycle and its most common use cases. Then it moves to analyse in detail a less obvious implementation of this technology: how to create a wiki engine using ServiceWorker and IndexedDB.
Step By Step Guide For Buidling Simple Struts AppSyed Shahul
This document provides steps to build a simple Struts application, including creating forms, actions, configuration files, and JSP pages. The key steps are:
1. Set up the project directory structure and files like web.xml.
2. Define forms, actions, and mappings in struts-config.xml.
3. Create ActionForm classes to handle form fields and validation.
4. Write Action classes to process requests and select views.
5. Develop JSP pages to display forms and output using Struts tags.
6. Build, deploy and test the complete application.
This document provides an overview of Spring and Spring Boot frameworks. It discusses the history of Java and Spring, how Spring provides inversion of control and dependency injection. It also covers Spring MVC for web applications, Spring Data for data access, and how Spring Boot aims to simplify configuration. The document concludes with discussing some next steps including looking at Spring Security, Spring Cloud, and using Spring with other JVM languages.
This document summarizes some of the key enhancements between Java 6 and Java 7, including improved type inference for generics, new syntax for number and string literals, expanded exception handling with multi-catch and try-with-resources, and new concurrency utilities like the Fork/Join framework and NIO watch service. It also covers miscellaneous features like symbolic file links and method handles.
Avinash Kundaliya: Javascript and WordPresswpnepal
This document discusses JavaScript and how it is used on over 92% of websites. It covers JavaScript fundamentals like variable scope, hoisting, and the this keyword. It also discusses how JavaScript allows first-class functions and functional programming. The document then covers how to properly manage scripts in WordPress using functions like wp_register_script, wp_enqueue_script, and wp_localize_script to internationalize scripts. It concludes by mentioning additional JavaScript topics to explore like closures and functional programming.
How to Build a Module in Odoo 17 Using the Scaffold MethodCeline George
Odoo provides an option for creating a module by using a single line command. By using this command the user can make a whole structure of a module. It is very easy for a beginner to make a module. There is no need to make each file manually. This slide will show how to create a module using the scaffold method.
How to Fix the Import Error in the Odoo 17Celine George
An import error occurs when a program fails to import a module or library, disrupting its execution. In languages like Python, this issue arises when the specified module cannot be found or accessed, hindering the program's functionality. Resolving import errors is crucial for maintaining smooth software operation and uninterrupted development processes.
A review of the growth of the Israel Genealogy Research Association Database Collection for the last 12 months. Our collection is now passed the 3 million mark and still growing. See which archives have contributed the most. See the different types of records we have, and which years have had records added. You can also see what we have for the future.
How to Add Chatter in the odoo 17 ERP ModuleCeline George
In Odoo, the chatter is like a chat tool that helps you work together on records. You can leave notes and track things, making it easier to talk with your team and partners. Inside chatter, all communication history, activity, and changes will be displayed.
हिंदी वर्णमाला पीपीटी, hindi alphabet PPT presentation, hindi varnamala PPT, Hindi Varnamala pdf, हिंदी स्वर, हिंदी व्यंजन, sikhiye hindi varnmala, dr. mulla adam ali, hindi language and literature, hindi alphabet with drawing, hindi alphabet pdf, hindi varnamala for childrens, hindi language, hindi varnamala practice for kids, https://www.drmullaadamali.com
This presentation includes basic of PCOS their pathology and treatment and also Ayurveda correlation of PCOS and Ayurvedic line of treatment mentioned in classics.
Executive Directors Chat Leveraging AI for Diversity, Equity, and InclusionTechSoup
Let’s explore the intersection of technology and equity in the final session of our DEI series. Discover how AI tools, like ChatGPT, can be used to support and enhance your nonprofit's DEI initiatives. Participants will gain insights into practical AI applications and get tips for leveraging technology to advance their DEI goals.
This presentation was provided by Steph Pollock of The American Psychological Association’s Journals Program, and Damita Snow, of The American Society of Civil Engineers (ASCE), for the initial session of NISO's 2024 Training Series "DEIA in the Scholarly Landscape." Session One: 'Setting Expectations: a DEIA Primer,' was held June 6, 2024.
The simplified electron and muon model, Oscillating Spacetime: The Foundation...RitikBhardwaj56
Discover the Simplified Electron and Muon Model: A New Wave-Based Approach to Understanding Particles delves into a groundbreaking theory that presents electrons and muons as rotating soliton waves within oscillating spacetime. Geared towards students, researchers, and science buffs, this book breaks down complex ideas into simple explanations. It covers topics such as electron waves, temporal dynamics, and the implications of this model on particle physics. With clear illustrations and easy-to-follow explanations, readers will gain a new outlook on the universe's fundamental nature.
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Dr. Vinod Kumar Kanvaria
Exploiting Artificial Intelligence for Empowering Researchers and Faculty,
International FDP on Fundamentals of Research in Social Sciences
at Integral University, Lucknow, 06.06.2024
By Dr. Vinod Kumar Kanvaria
Main Java[All of the Base Concepts}.docxadhitya5119
This is part 1 of my Java Learning Journey. This Contains Custom methods, classes, constructors, packages, multithreading , try- catch block, finally block and more.
How to Setup Warehouse & Location in Odoo 17 InventoryCeline George
In this slide, we'll explore how to set up warehouses and locations in Odoo 17 Inventory. This will help us manage our stock effectively, track inventory levels, and streamline warehouse operations.
Strategies for Effective Upskilling is a presentation by Chinwendu Peace in a Your Skill Boost Masterclass organisation by the Excellence Foundation for South Sudan on 08th and 09th June 2024 from 1 PM to 3 PM on each day.
3. INTRODUCTION
Our project explains about the student
management. This project mainly explains the
various actions related to student details. This
project shows some ease in adding, editing and
deleting the student details. It also provides a
less time consuming process for viewing, adding,
editing and deleting the marks of the students
Presentation title 3 20XX
4. 20XX
Presentation title 4
Source code: College management System
package collegemangementsystem;
import java.sql.*;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
public class CollegeMangementSystem {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
System.out.println(" JDBC Start ");
System.out.println("Programis running on gui...");
HomePage hp = new HomePage();
hp.setVisible(true);
}
}
5. 20XX
Presentation title 5
Source code: Homepage.java
package collegemangementsystem;
public class HomePage extends javax.swing.JFrame {
public HomePage() {
initComponents();
}
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jPanel1 = new javax.swing.JPanel();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
jButton4 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("HomePage");
setBackground(new java.awt.Color(255, 255, 102));
12. 20XX
Presentation title 12
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
System.out.println("Add new Student detail btn Clicked");
System.out.println("StudentLoginPage GUI Page Open");
StudentLoginPage slp = new StudentLoginPage();
slp.setVisible(true);
}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
System.out.println("Delete Student detail tn clicked.");
System.out.println("Delete Frame OPened.");
DeleteStudentDetails dsd = new DeleteStudentDetails();
dsd.setVisible(true);
}
13. 20XX
Presentation title 13
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
System.out.println("Clicked Update Btn ");
UpdateDetailsPage upd = new UpdateDetailsPage();
upd.setVisible(true);
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
15. 20XX
Presentation title 15
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new HomePage().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3;
private javax.swing.JButton jButton4;
private javax.swing.JLabel jLabel1;
private javax.swing.JPanel jPanel1;
// End of variables declaration
}
16. 20XX
Presentation title 16
Source code: Home page.java
package collegemangementsystem;
/**
*
* @author kishor
*/
public class HomePage extends javax.swing.JFrame {
/**
* Creates new form HomePage
*/
public HomePage() {
initComponents();
}
17. 20XX
Presentation title 17
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jPanel1 = new javax.swing.JPanel();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jButton3 = new javax.swing.JButton();
jButton4 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("HomePage");
setBackground(new java.awt.Color(255, 255, 102));
24. 20XX
Presentation title 24
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
System.out.println("Add new Student detail btn Clicked");
System.out.println("StudentLoginPage GUI Page Open");
StudentLoginPage slp = new StudentLoginPage();
slp.setVisible(true);
}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
System.out.println("Delete Student detail tn clicked.");
System.out.println("Delete Frame OPened.");
DeleteStudentDetails dsd = new DeleteStudentDetails();
dsd.setVisible(true);
}
25. 20XX
Presentation title 25
private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
System.out.println("Clicked Update Btn ");
UpdateDetailsPage upd = new UpdateDetailsPage();
upd.setVisible(true);
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
26. 20XX
Presentation title 26
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(HomePage.class.getName()).log(java.util.logging.Level.SEVERE, null,
ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(HomePage.class.getName()).log(java.util.logging.Level.SEVERE, null,
ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(HomePage.class.getName()).log(java.util.logging.Level.SEVERE, null,
ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(HomePage.class.getName()).log(java.util.logging.Level.SEVERE, null,
ex);
}
//</editor-fold>
/* Create and display the form */
27. 20XX
Presentation title 27
}
// Variables declaration - do not modify
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton3;
private javax.swing.JButton jButton4;
private javax.swing.JLabel jLabel1;
private javax.swing.JPanel jPanel1;
// End of variables declaration
}
28. 20XX
Presentation title 28
Source code: Search page.java
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package collegemangementsystem;
import java.sql.*;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
29. 20XX
Presentation title 29
public class SearchPage extends javax.swing.JFrame {
/**
* Creates new form SearchPage
*/
public SearchPage() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
30. 20XX
Presentation title 30
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jPanel1 = new javax.swing.JPanel();
jLabel2 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jScrollPane1 = new javax.swing.JScrollPane();
tb1 = new javax.swing.JTable();
setBackground(new java.awt.Color(204, 255, 204));
40. 20XX
Presentation title 40
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
jTextField1.setText(" ");
System.out.println(" Cleared ");
tb1.setModel(new DefaultTableModel());
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
42. 20XX
Presentation title 42
Source code: Student Login page.Java
package collegemangementsystem;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import java.sql.*;
public class StudentLoginPage extends javax.swing.JFrame {
public StudentLoginPage() {
initComponents();
}
43. 20XX
Presentation title 43
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jTextField4 = new javax.swing.JTextField();
jTextField5 = new javax.swing.JTextField();
jTextField1 = new javax.swing.JTextField();
jTextField2 = new javax.swing.JTextField();
jTextField3 = new javax.swing.JTextField();
jButton1 = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
52. 20XX
Presentation title 52
Source code: Update details page.java
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package collegemangementsystem;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
import javax.swing.JOptionPane;
53. 20XX
Presentation title 53
public class UpdateDetailsPage extends javax.swing.JFrame {
/**
* Creates new form UpdateDetailsPage
*/
public UpdateDetailsPage() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
54. 20XX
Presentation title 54
private void initComponents() {
jLabel2 = new javax.swing.JLabel();
jLabel1 = new javax.swing.JLabel();
jPanel1 = new javax.swing.JPanel();
jLabel3 = new javax.swing.JLabel();
tf1 = new javax.swing.JTextField();
jButton2 = new javax.swing.JButton();
jButton1 = new javax.swing.JButton();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jTextField2 = new javax.swing.JTextField();
jTextField3 = new javax.swing.JTextField();
jTextField4 = new javax.swing.JTextField();
jTextField5 = new javax.swing.JTextField();
64. 20XX
Presentation title 64
// TODO add your handling code here:
String url = "jdbc:mysql://localhost:3306/stinfo";
String user = "root";
String password = "";
Connection con = DriverManager.getConnection(url, user, password);
Statement st = con.createStatement();
String Tf1 = tf1.getText();
String queryDel = "update Students set
dept='"+tfDept+"',Email='"+tfEmail+"',Mobile='"+tfMob+"',Name='"+tfName+"'";
int res= st.executeUpdate(queryDel);
System.out.println("Result = "+ res);
}catch (SQLException ex) {
System.out.println("Some Other error Occured");
}
}
private void jTextField2ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
}
65. 20XX
Presentation title 65
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels())
{
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(UpdateDetailsPage.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(UpdateDetailsPage.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
66. 20XX
Presentation title 66
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(UpdateDetailsPage.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(UpdateDetailsPage.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new UpdateDetailsPage().setVisible(true);
}
});
}
68. 20XX
Presentation title 68
Source code: Delete student details.Java
*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package collegemangementsystem;
import javax.swing.JOptionPane;
import java.sql.*;
/**
69. 20XX
Presentation title 69
public class DeleteStudentDetails extends javax.swing.JFrame {
/**
* Creates new form DeleteStudentDetails
*/
public DeleteStudentDetails() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
70. 20XX
Presentation title 70
jLabel1 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
jButton1 = new javax.swing.JButton();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jButton2 = new javax.swing.JButton();
jLabel1.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
jLabel1.setText("Student Id:");
jTextField1.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
jButton1.setBackground(new java.awt.Color(255, 204, 204));
jButton1.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
jButton1.setForeground(new java.awt.Color(255, 0, 51));
jButton1.setText("Delete");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
75. 20XX
Presentation title 75
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
try {
// TODO add your handling code here:
String url = "jdbc:mysql://localhost:3306/stinfo";
String user = "root";
String password = "";
Connection con = DriverManager.getConnection(url, user, password);
Statement st = con.createStatement();
String Tf1 = jTextField1.getText();
String queryDel = "Delete from Students where reg = "+Tf1;
int res= st.executeUpdate(queryDel);
System.out.println("Result = "+ res);
if(res==1){
System.out.println("deleted Sucessfully ");
JOptionPane.showMessageDialog(rootPane," Delete Sucessful. ");
}
76. 20XX
Presentation title 76
else{
System.out.println("No any such id found ");
JOptionPane.showMessageDialog(rootPane," No any such id found ");
}
}catch (SQLException ex) {
System.out.println("Some Other error Occured");
}
// Logger.getLogger(DeleteStudentDetails.class.getName()).log(Level.SEVERE, null, ex);
}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
jTextField1.setText(" ");
}
/**
* @param argsthe command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
77. 20XX
Presentation title 77
try {
for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(DeleteStudentDetails.class.getName()).log(java.util.logging.Level.SEV
ERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(DeleteStudentDetails.class.getName()).log(java.util.logging.Level.SEV
ERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(DeleteStudentDetails.class.getName()).log(java.util.logging.Level.SEV
ERE, null, ex);
78. 20XX
Presentation title 78
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(DeleteStudentDetails.class.getName()).log(java.util.logging.Level.SEVERE,
null, ex);
}
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new DeleteStudentDetails().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JButton jButton1;
private javax.swing.JButton jButton2;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JTextField jTextField1; }