Java Bangla Book Download

Posted on  by 



Java

Bangla Books Online

weQwgjøvwni
: : :
E-mail
:
[email protected][email protected]
: : : :
ISBN
:
:
978-984-8812-91-4
বইটির ববশিষ্ট্য:        
বইটির মাধ্যমম হমে পামর আপনার প্রাগ্রাশমিং এর শুরু। রশেটি শবষয় ধামপ ধামপ সহজ ভামব উপস্থাপন হময়মে । কময়কটি রাকটিকযাল রমজক্ট কমর প্েখামনা হময়মে । গ্রাশিকযাল ইউজার ইন্টারমিইস এর ব্যবহার প্েখামনা হময়মে । প্নটশবনস, প্জশিময়টর এবিং ই-শিপস এর ব্যবহার প্েখামনা হময়মে । বইটি পড়ার জন্য প্কান প্রাগ্রাশমিং জ্ঞান থাকার রময়াজন প্নই । রশেটি অধ্যাময় এবিং শিশভশিমে রচুর রযাকটিস প্রাগ্রাম প্েওয়া হময়মে । শবশ্বশবদ্যালয় এবিং শবশভন্ন শিক্ষা রশেষ্ঠামনর শসমলবাস অনুযায়ী রণীে ।
   
[email protected]|
www.bookbd.info
 
 
Jcreator, Netbeans clipse
  [email protected]
 www.bookbd.info
facebook.com/mmr.sinha [email protected] www.bookbd.info facebook.com/ebookbd
E-
Environment
(Operator & Expresssion) Decesion Making (Loop) (Break & Continue) (Array)
(String)
(Inheritance)
(Graphical User Interface & Netbeans) (Calculator) (Make Invoice) (Age Calculator) (Temparature Converter) (Tic Tac Toe) (Point of Sale System) (Temparature Converter) (Phone Book Record System)
(Application)
(Lexical Elements)
Environment Environment (Java IDE) (JDK) (Command Prompt) (Jcreator) (Netbeans) (Eclipse)
(Setting up your Computer) (Steps in Writing Java Program)
Prompt (Error)
Numerical Data
Rules for Variable Declaration
History) Charcteristic
(JDK & JVM)
(Operator & Expresssion)
(Expresssion) (Operator Types) (Arithmetic Operator) (Assignment Operator) (Comparision Operators) (&&/and) (Logical Operator) (Precedence of Arithmatic Operator) (Bitwise Operator)
Decesion Making : : : : : : :
Conditional Statement If statement Multiple If statement Nested If If----Else Switch
: :
(Loop) : :
: : : :
Loop Type of Loop For Loop (While Loop) (Do-While Loop)
(Break & Continue)
(Break) (Break Syntax) (Continue) Statement
(Array)
(Array) Syntax Intialization
(Two Demensional Array) Vector Vector Syntax Operation
(Method) (Method)
(Syntax) (Method Define) (Calling Method) (Arguments)
(Over Loading)
(Constructor) Constructor (Characteristic) Constructor Constructor
(String)
(String) (String Class) (String Operation)
Console Scanner
(Modifier) (Access Control Modifier) (Non Access Modifier) (public) (Default) (Private) (Protected) (Non Access Modifier)
(Inheritance)
(Inheritance)
(Syntax of Inheritance)
(this) (Type of Inheritance)
(Abstruct)
(Encapsulation)
(Interface)
(Java Pakage) (Client Server Computing) (Java Applet) (Input Stream Class) (Data Stream) (Thread) (Exception) (Swing & GUI) (Graphical User Interface & Netbeans) Netbeans Installation (File Menu) (Edit Menu) (View Menu) (J-Frame Form) Palette (Message Display) (Message Display Using Button Click) (Create User Interface of Calculator) (Calculator) (Name of Project) (purpose of this project) (Feature of this project) (Input and Output) (How to create project)
(Source code of this project) (Run the project) (Make Invoice) (Name of Project) (purpose of this project) (Feature of this project) (Input and Output) (How to create project) (Source code of this project) (Run the project) (Age Calculator) (Name of project) (Purpose of this project) (Feature of this project) (Input and Output) (Create project) (Project source code) (Temparature Converter) (Name of Project) (purpose of this project) (Feature of this project) (Input and Output) (How to create project) (Source code of this project) (Run the project) (Tic Tac Toe) (Name of Project) (purpose of this project) (Feature of this project) (Input and Output) (How to create project) (Source code of this project) (Run the project)
(Point of Sale System) (Name of Project) (purpose of this project) (Feature of this project) (Input and Output) (How to create project) (Source code of this project) (Run the project) (Temparature Converter) (Name of Project) (purpose of this project) (Feature of this project) (Input and Output) (How to create project) (Source code of this project) (Phone Book Record System) (Name of the Project) (Objective of this Project) (Feature of this Project) (Create Project) (Source Code) (Run Project)
(Application)
open
(Translator)
(Java): C C
(Intermediate) PHP (JavaScript):
C (Cobol)
(HTML) (Python) (Prolog) (QBasic) (Ruby) (SQL) (Visual Basic)
(Hierarchy of Computer Language) Low-level Language Intel X86. High-level Language
(Assembly)
(manage) Windows, Android, Linux
Application
(Application)
1.10 (OS) mp3
Low Level
(High Level)
(Lexical Elements)
Public, This, Private, Static, class
James Gosling
Sun
MicroSystem
Reserve Word That One Predefined in Language]. Abstract Break Default Else If Instanceof Package Protect Synchronized Throws Assert Ed Do Exten Implements Int Private Ds This Return Boolean Public Import False Double Byte Throw Case
Transient Short Interface Catch Long Final Try Static True Char Finally Native Strictfp Void
[Reserve Class Float New Super volatile const for null switch while continue goto
Lexical Elements White Space Comments Identifier) Reserved Words) Literals) Delimiters) Operators Space
Ignore those code
Single Line Comments Multi Line Comments Javadoc Comments Forword Slash
//Dhaka; Dhaka //Dhaka; Bangladesh; //Comilla; Dhaka
/* text */
Comilla
Bangladesh
/* Dhaka; Bangladesh */ Dhaka Bangladesh (External)
/** text */ /** Dhaka; Bangladesh */ Dhaka Bangladesh
Letter, Numbers and Underscore name dog p xm nima $pu -2ah bd Applet black&white A+ Java www.bookbd.info phone# grade_report Class instructor's name 99bottles false theBuyFigureForTheFiscalYear2014 $865
Instance Blue Print
Translate
.java Editor
.class JDK Java Development Kit Textpad, JCreator, Netbeans, Eclips 2, 10, 65, 'a', 'k', 'Dhaka'
a, p, p5, dom
int, long, byte, short,char, float, double Ges Boolean Symbol +(Addition), -(Subtraction), ++(Increment), (equal), >(is greater than), && (and)
JCreator
do, else, private, public, null, new Oak
Environment Environment (Java IDE) (JDK) (Command Prompt) (Jcreator) (Netbeans) (Eclipse)
Environment Java
www.java.com/verify
JRE (Java Runtime Environment) Verify Java Version G
Run
Confirmation Message
www.java.com/getjava/
Agree and Start Free Download
1. Java JRE (Java Runtime Environment) 2. Java JDK (Java Development Kit) 3. Java IDE (Java Intergraded Development Environment) a. Net Beans b. Eclipse c. jCreator etc.
(Java IDE) A Java IDE (Integrated Development Environment) software application debug IDE syntax highlighting and code completion IDE Ecilpse, NetBeans, JCreator, BlueJ, Processing, Kawa, JBuilder, DrJava
(JDK) Java JDK(Java Development Kit) JDK JDK-7 (Javac), JDK
JDK (Javadoc) JRE
(JRE),
(Java), JRE JDK
JDK (http://www.oracle.com/technetwork/java/javase/downloads/index.html) JDK
SE
(Command Prompt) Run Program in Black Screen

JDK install FilesJavajdk1.7.0_51bin Address
program files
C:Program
My Computer -> properties ->Advance System Setting -> Environment Variable
Path Address Java
Edit Value Apply Balck Screen
JDK
I love Java Programming .
.java)
JavaRun.java
Start+R
RUN
cmd
Computer->Workstation-> Run Java F: ] Java ]
javac
javaRun.java] Run Java [cd Run [dir] javaRun.java Enter
java Class
(dir) (filename.class) java java javaRun
Enter (“I love Java
Programming”)
cmd
(J creat or) program software application IDE completion Java IDE
Java IDE (Integrated Development Environment) debug syntax highlighting and code Jcreato
Jcreator Jcreator
CD
Software
JDK
Jcreator
Yes
setup Yes Jcreator
Next
Jcreator 1.5 Box Open Jcreator 1.5
Start Button
Main menu
Jcreator Open
Jcreator 1.5
Jcreator Source File Java Source File Select
Next
Next
JDK Home directory Finish
File Open File
New G
File
File Name
Class Name
Class Name select Compile
Jcreator
program
(Netbeans) Netbeans
? C, C++, JAVA IDE
IDE Netbeans
NetBean
NetBean
GUI(Graphical NetBean
User Interface) https://netbeans.org/downloads/] NetBean
NetBean NetBean
“I accept the terms in the license agreement”
next
JUnit
“I accept the terms in the license agreement, Install Unit”
next
NetBean NetBean
Programming Files JDK(Java Development Kit) JDK
Next
Install
NetBean
Finish
NetBean
NetBean File
Java Application
New Project Next
Project Name
First Java Program Next
Edit Area ÓFirst Java Program at NetBeans IDE
Run File|
Output IDE
Pakage explorer RUN
Edit
Run
ÓFirst Java Program at NetBeans
File Menu
File Menu New Project: New option Shortcut: Ctrl+Shift+N New File: New File option Shortcut: Ctrl+N . Open Project: Shortcut: Ctrl+Shift+O . Open Recent Project: . Close Project: . Open File: . Open Recent File: . Project Group: group . Project Properties: . ImportProject: zip
import
. ExportProject: export . Save: Shortcut: Ctrl+S . SaveAll: Shortcut: Ctrl+Shift+S . Page Setup: . Print: Shortcut: Ctrl+Alt+Shift+P . Print: Shortcut: Ctrl+Alt+Shift+P . Print to HTML: HTML . Exit: D³
(Eclipse) Eclipse ? program JAVA IDE Java IDE (Integrated Development Environment) software application debug IDE syntax highlighting and code completion Eclipse Java IDE eclipse open-source community Eclipse Eclipse download http://www.eclipse.org/downloads Google eclipse download
Google Eclipse Downloads
click
Eclipse
bit
windows computer menu
properties 64 Bit.
bit mouse
bit right button
Windows click
computer 32 Bit
bit
download link
Eclipse Download link
click
download
eclipse
Eclipse zip eclipse workspace
location
extract eclipse.exe workspace
Eclipse
workspace
“Use this as the default and do not ask again”,
Eclipse eclipse Platform IDE Dev., C/C++, XML
prospective software
Menu option
option toolbar
Cross JAVA, Android JAVA prospective Menubar
Eclipse
4 edit
outline view
৫ ৬
Eclipse

Editor
problem view Project Explorer
output
error
program
Eclipse java Program print java project
program eclipse menu bar
Hello World! This is my first file click New, new
project New java project Finish
project name project_name FirstJavaProgram]
project
project explorer Class File
New
class source Name HelloWorld option
Modifier (public, private etc)
class
Editor Area “Hello world! This is my first java program”
Eclipse
Pakage Explorer Toolbar Menubar Run This is my first java program”
program
run
output
RUN Run File Console
Output
“Hello world!
(Setting up your Computer) (Steps in Writing Java Program)
Prompt (Error)
Java Development Kit 1:
2:
3:
Physical JDK
Bin
JCreator
Setting up your Computer Execute Platfrom
API JVM
Interpreted Environment
API JVM Intregrated Development
JDK Java Development Kit (Install)
http://www.javasoft.com
Textpad, JCreator, Netbeans, Eclips
(FirstJava.java) public class FirstJava { public static void main(String args[]) { System.out.println('My First Program'); } }
(FirstJava.java)     
FirstJava.Java Command Prompt C:)| FirstJava.Java
Enter
FirstJava My First Program
***
JCreator JCreator
JCreator JCreator V1
JCreator
JCreator New
project
New Window Java File
ok
Files by default Java File, HTML File, Text File book
JCreator (book.java) public class book { public static void main(String args[]) { System.out.println('Bookbd Series'); } }
(book.java) String
S
Capital Letter
System
S
Capital Letter
book Error Compile
Execute Execute
Execute book Execute
Bookbd Series
Steps in Writing Java Program
(execute) : JCreator book.java
Eclips
Netbeans. book
: :
Notepad++, Textpad, .java ( book
Compile JDK Java Runtime
(bd.java public class bd //The name of class is { public static void main(String args[]) { // This is main Method System.out.println('Dhaka'); // System.out.printLn('Bangladesh'); /* In this program comments do not execute. Its use fast for developer help. In this program the output will be dhaka */ } }
double slash Dhaka.
slash star
(Create project) jcreator File New Project Categories Java Projects Java Application Next Project Name softway Finish Source Run softway public class newc.class & oldc.class
(Project source code) import java.util.Scanner; public class SoftWay extends inheritance{ public static void main(String[] args){ full(); } public static void full() //full=full program{ System.out.println('ttt---------------------------------'); System.out.println('tttWelcome to opur Softway Supershop'); System.out.println('ttt---------------------------------nn'); product(); //inheritance called System.out.println('nntt7 1. New Customer'); System.out.println('tt 2. Old Customer'); char c; Scanner sc=new Scanner(System.in); System.out.print('tt Please Press (1/2) '); c=sc.nextLine().charAt(0); if(c'1') //for new customer{ newc obj=new newc(); obj.cni(); }else if(c'2') //for old customer{ oldc obj2=new oldc(); obj2.cid(); }else full(); Scanner bc=new Scanner(System.in); System.out.print('nnttPress m to return main menu or press any other key to exit '); int b=bc.nextLine().charAt(0); if(b'm') full(); } } class inheritance{ public static void product(){
System.out.println('tt----------------------------------------------------'); System.out.println('tt| Product Name || Product Code |'); System.out.println('tt----------------------------------------------------'); System.out.println('tt| Rice (5 KG) || RC11 |'); System.out.println('tt----------------------------------------------------'); System.out.println('tt| Beef (1 KG) || BF11 |'); System.out.println('tt----------------------------------------------------'); System.out.println('tt| Vegetable || VG11 |'); System.out.println('tt----------------------------------------------------'); System.out.println('tt| Salt || SL11 |'); System.out.println('tt----------------------------------------------------'); System.out.println('tt| Toothpaste || TP11 |'); System.out.println('tt----------------------------------------------------'); System.out.println('tt| Shampoo || SM11 |'); System.out.println('tt----------------------------------------------------'); System.out.println('tt| Milk Vitae || MV11 |'); System.out.println('tt----------------------------------------------------'); System.out.println('tt| Perfume || PR11 |'); System.out.println('tt----------------------------------------------------'); System.out.println('tt| Cold Drinks (2 Litr) || CD11 |'); System.out.println('tt----------------------------------------------------'); }} class newc{//newc=new customer static int i=235; static double t; //t= total public static void cni(){ String cname; //cname=customer name Scanner sc=new Scanner(System.in); System.out.print(' n tttCustomer Name: '); cname=sc.nextLine(); System.out.println('7 tttCustomer ID : ' + (i++)); prices(); footer(); } public static void prices(){ String pcode; //pcode=product code double tp=0,tv=0; //tp=total price & tv=total vat int j; for(j=0;j<20;j++){ System.out.print('ntttttt(Press t for calculate total)n'); System.out.print('tttCode : ');
Scanner pr=new Scanner(System.in); pcode=pr.nextLine(); int price; double vat; if('t'.equals(pcode)) break; switch(pcode){ case 'RC11': case 'rc11': price=200; vat=0*price; tp=tp+price; tv=tv+vat; System.out.println('tttProduct: Rice (5 KG)'); System.out.println('tttPrice : '+price+' Tk'); System.out.println('tttVat : '+vat+' Tk'); break; case 'BF11': case'bf11' : price=200; vat=0*price; tp=tp+price; tv=tv+vat; System.out.println('tttProduct: Beef (1 KG)'); System.out.println('tttPrice : '+price+' Tk'); System.out.println('tttVat : '+vat+' Tk'); break; case 'VG11': case 'vg11': price=300; vat=0*price; tp=tp+price; tv=tv+vat; System.out.println('tttProduct: Vegetable'); System.out.println('tttPrice : '+price+' Tk'); System.out.println('tttVat : '+vat+' Tk'); break; case 'SL11': case 'sl11': price=60; vat=Math.ceil(0.1*price); // math.ceil() is used for round value tp=tp+price; tv=tv+vat; System.out.println('tttProduct: Salt'); System.out.println('tttPrice : '+price+' Tk');
System.out.println('tttVat : '+vat+' Tk'); break; case 'TP11': case 'tp11': price=50; vat=Math.ceil(.1*price); tp=tp+price; tv=tv+vat; System.out.println('tttProduct: Toothpaste'); System.out.println('tttPrice : '+price+' Tk'); System.out.println('tttVat : '+vat+' Tk'); break; case 'SM11': case 'sm11': price=215; vat=Math.ceil(.1*price); tp=tp+price; tv=tv+vat; System.out.println('tttProduct: Shampoo'); System.out.println('tttPrice : '+price+' Tk'); System.out.println('tttVat : '+vat+' Tk'); break; case 'MV11': case 'mv11': price=58; vat=Math.ceil(.1*price); tp=tp+price; tv=tv+vat; System.out.println('tttProduct: Milk Vitae'); System.out.println('tttPrice : '+price+' Tk'); System.out.println('tttVat : '+vat+' Tk'); break; case 'PR11': case 'pr11': price=220; vat=Math.ceil(.1*price); tp=tp+price; tv=tv+vat; System.out.println('tttProduct: Perfume'); System.out.println('tttPrice : '+price+' Tk'); System.out.println('tttVat : '+vat+' Tk'); break; case 'CD11': case 'cd11': price=82; vat=Math.ceil(.1*price);
tp=tp+price; tv=tv+vat; System.out.println('tttProduct: Cold Drinks (2 Litr)'); System.out.println('tttPrice : '+price+' Tk'); System.out.println('tttVat : '+vat+' Tk'); break; default: System.out.println('tttPlease enter correct code'); } } //end of for loop System.out.println('ntttTotal Price: '+tp+' Tk'); System.out.println('tttTotal Vat : '+tv+' Tk'); t=tp+tv; System.out.println('tttTotal : '+t+' Tk'); } public static void footer() { System.out.println('nttttThank You'); System.out.println('ntttttttZahid & Manik'); System.out.println('nttttttt-------------'); System.out.println('nttttttt Signature'); } } class oldc //oldc=old customer{ public static void cid() //cid=customer id { newc obj3=new newc(); Scanner pr=new Scanner(System.in); System.out.print(' n tttCustomer ID: '); int id; id=pr.nextInt(); if(id>=235 && id
(Run project) JCreator/NetBeans Project
File
directory
jcreator
(press compile button and find process completed)
Open
(click execute button)
(Projectrunning)
(Selected Product)
(Cash memo)
(Temparature Converter) (Name of Project) (purpose of this project) (Feature of this project) (Input and Output) (How to create project) (Source code of this project)
(Name of project) (GUI) Temperature converter
(Purpose of this project) (Unit)
(Feature of this project)      
Celsius to Fahrenheit Celsius to Kelvin Fahrenheit to Celsius Fahrenheit to Kelvin Kelvin to Celsius Kelvin to Fahrenheit
(Input and Output) 23 296.15
Code
Run
(Sample input & output)
(Create project) Netbeans File Projects Java Applicaion Temp Finish
New Project Next
NetBeans
Catagories Java Project Name
NetBeans
Projects
Temp New
Source Packages JFrame Form
New JFrame Form—G Class Name: Finish
GUI
Graphical User Interface
temp
GraphicalUserInterface Swing Containers Etched Border
NetBeans Panel Ok
(GUI-
JPanel1
GraphicalUser Interface Properties Design
Design page)
border
Palette NetBeans Border
Label Temperature Converter
Edit Text
Label Properties
font-
JLabel1
font
Properties
foreground
Properties
Background
background color change
GUI
Pallete Swing Controls 13, 14, 15
JLabel
JLabel2
From
Graphical User Interface Properties Model
Swing Controls
Combo Box
Combo Box
Text
model-
Text Field Enter Value
Edit
Text Field
Panel
Swing Containers
Panel
Panel Palette Swing Controls Convert Close
Properties
Button icon
drag
temp package
icon drag
Edit Text
Convert Button
Properties
icon
JButton1
JButton1
font
icon select
font
Panel
Button
Clear
JButton2 Panel
font change
Properties
(background color change)
Pallete
Swing Menus
Menu Bar
Menu Bar File
Properties
File
Add From Pallete
File icon
icon changing
JMenuItem1
Edit Text
Shortcut Key
Edit
Delete
Exit
Edit Delete GUI
Design
GraphicalUserInterface.java source code copy paste Shift+11
GraphicalUserInterface.java
directory
Temp.java .jar file
Source
Temp.java
(.jar location)
(Project source code) Temp.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 temp; /** * * @author Badal */ public class Temp { /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new GraphicalUserInterface().setVisible(true); } }); } }
GraphicalUserInterface.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 temp; /** * * @author Badal */ public class GraphicalUserInterface extends javax.swing.JFrame { /**
* Creates new form GraphicalUserInterface */ public GraphicalUserInterface() { 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() { jPanel1 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); jPanel2 = new javax.swing.JPanel(); jLabel2 = new javax.swing.JLabel(); jComboBox1 = new javax.swing.JComboBox(); jTextField1 = new javax.swing.JTextField(); jButton1 = new javax.swing.JButton(); jPanel3 = new javax.swing.JPanel(); jLabel3 = new javax.swing.JLabel(); jComboBox2 = new javax.swing.JComboBox(); jTextField2 = new javax.swing.JTextField(); jButton2 = new javax.swing.JButton(); jMenuBar1 = new javax.swing.JMenuBar(); jMenu1 = new javax.swing.JMenu(); jMenuItem1 = new javax.swing.JMenuItem(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jPanel1.setBackground(new java.awt.Color(255, 255, 153));Panel1.setBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.bord er.EtchedBorder.RAISED)); jLabel1.setFont(new java.awt.Font('Engravers MT', 3, 25)); // NOI18N jLabel1.setForeground(new java.awt.Color(153, 153, 0)); jLabel1.setText(' Temperature Converter'); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap()
.addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 616, Short.MAX_VALUE) .addContainerGap()) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup() .addGap(28, 28, 28) .addComponent(jLabel1) .addContainerGap(23, Short.MAX_VALUE)) ); jPanel2.setBackground(new java.awt.Color(204, 255, 204)); jLabel2.setFont(new java.awt.Font('Batang', 1, 20)); // NOI18N jLabel2.setForeground(new java.awt.Color(0, 51, 153)); jLabel2.setText('From'); jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { 'Select', 'Celsius', 'Fahrenheit', 'Kelvin' })); jComboBox1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jComboBox1ActionPerformed(evt); } }); jTextField1.setText('Enter value'); jButton1.setFont(new java.awt.Font('Tahoma', 1, 15)); // NOI18N jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource('/temp/gtkconvert.png'))); // NOI18N jButton1.setText('Convert'); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() .addContainerGap()
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(37, 37, 37) .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, 122, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE ADING, false) .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jTextField1)) .addGap(76, 76, 76)) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BAS ELINE) .addComponent(jLabel2) .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 53, Short.MAX_VALUE) .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(30, 30, 30)) ); jPanel3.setBackground(new java.awt.Color(204, 255, 204)); jLabel3.setFont(new java.awt.Font('Batang', 1, 20)); // NOI18N jLabel3.setForeground(new java.awt.Color(0, 51, 153)); jLabel3.setText('To');
jComboBox2.setModel(new javax.swing.DefaultComboBoxModel(new String[] { 'Select', 'Celsius', 'Fahrenheit', 'Kelvin' })); jTextField2.setText('Result'); jTextField2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField2ActionPerformed(evt); } }); jButton2.setFont(new java.awt.Font('Tahoma', 1, 15)); // NOI18N jButton2.setText('Clear'); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3); jPanel3.setLayout(jPanel3Layout); jPanel3Layout.setHorizontalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup() .addContainerGap() .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 59, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(37, 37, 37) .addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, 122, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, 125, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(74, 74, 74)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 116, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(246, 246, 246)) ); jPanel3Layout.setVerticalGroup( Panel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BAS ELINE) .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jComboBox2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 44, Short.MAX_VALUE) .addComponent(jButton2) .addGap(22, 22, 22)) ); jMenu1.setText('File'); jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEve nt.VK_F4, java.awt.event.InputEvent.ALT_MASK)); jMenuItem1.setIcon(new javax.swing.ImageIcon(getClass().getResource('/temp/button_cancel.png'))); // NOI18N jMenuItem1.setText('Exit'); jMenuItem1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem1ActionPerformed(evt); } }); jMenu1.add(jMenuItem1); jMenuBar1.add(jMenu1); setJMenuBar(jMenuBar1); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); pack(); }// private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: System.exit(0); } private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: n = Float.parseFloat(jTextField1.getText()) ; to = jComboBox2.getSelectedItem().toString(); from = jComboBox1.getSelectedItem().toString(); if ( from.equals('Celsius') ){ switch(to){ case 'Fahrenheit' : result = ((9.0f / 5.0f ) * n) + 32; jTextField2.setText(result.toString()); break ; case 'Kelvin' : result = (n * 1) + 273.15f; jTextField2.setText(result.toString()); break ;
default : result = n *1; jTextField2.setText(result.toString()); } } if ( from.equals('Fahrenheit') ){ switch(to){ case 'Celsius' : result = (n-32)*5/9f; jTextField2.setText(result.toString()); break ; case 'Kelvin' : result = ((n-32)*5/9f)+273.15f; jTextField2.setText(result.toString()); break ; default : result = n *1; jTextField2.setText(result.toString()); } } if ( from.equals('Kelvin') ){ switch(to){ case 'Fahrenheit' : result = ((n-273.15f)*9/5f)+32; jTextField2.setText(result.toString()); break ; case 'Celsius' : result = n-273.15f; jTextField2.setText(result.toString()); break ; default : result = n *1; jTextField2.setText(result.toString()); } } } private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: jTextField1.setText('); jTextField2.setText('); }
private void jComboBox1ActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: } private void jTextField2ActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: } /** * @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 */ 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(GraphicalUserInterface.class.getName()).log(java.util .logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(GraphicalUserInterface.class.getName()).log(java.util .logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(GraphicalUserInterface.class.getName()).log(java.util .logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(GraphicalUserInterface.class.getName()).log(java.util .logging.Level.SEVERE, null, ex); } // /* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new GraphicalUserInterface().setVisible(true); } });
} // Variables declaration - do not modify private javax.swing.JButton jButton1; private javax.swing.JButton jButton2; private javax.swing.JComboBox jComboBox1; private javax.swing.JComboBox jComboBox2; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JMenu jMenu1; private javax.swing.JMenuBar jMenuBar1; private javax.swing.JMenuItem jMenuItem1; private javax.swing.JPanel jPanel1; private javax.swing.JPanel jPanel2; private javax.swing.JPanel jPanel3; private javax.swing.JTextField jTextField1; private javax.swing.JTextField jTextField2; // End of variables declaration float n; String to ; String from; Float result; String [] temperature = {'Celsius','Fahrenheit','Kelvin'}; }
(Phone Book Record System) (Name of the Project) (Objective of this Project) (Feature of this Project) (Create Project) (Source Code) (Run Project)
(Name of the Project) (Phone Book Record System)
(Objective of this Project)
(Feature of this Project)  Save  Delete  Edit  Show
(Create Project) NetBeans File New Project Java Application Next Finish
Categories Java Projects Project Name- Phonebook
Phonebook, Login 3 class
Jframe
Main
class
(Source Code) Phonebook class source code: package phonebook; //import static com.oracle.util.Checksums.update; import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; import javax.swing.JOptionPane; import javax.swing.table.DefaultTableModel; public class Phonebook extends javax.swing.JFrame { private String search; public Phonebook() { initComponents(); } @SuppressWarnings('unchecked') // <editor-fold defaultstate='collapsed' desc='Generated Code'>//GENBEGIN:initComponents private void initComponents() { jPanel1 = new javax.swing.JPanel(); jLabel2 = new javax.swing.JLabel(); jLabel3 = new javax.swing.JLabel(); tfaddress = new javax.swing.JTextField(); tfname = new javax.swing.JTextField(); tfnumber = new javax.swing.JTextField(); btnsave = new javax.swing.JButton(); jPanel2 = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); tfsearch = new javax.swing.JTextField(); btnedit = new javax.swing.JButton(); btnshow = new javax.swing.JButton(); btndelete = new javax.swing.JButton(); jLabel4 = new javax.swing.JLabel(); jScrollPane1 = new javax.swing.JScrollPane(); jTable1 = new javax.swing.JTable(); btnload = new javax.swing.JButton(); jMenuBar2 = new javax.swing.JMenuBar(); jMenu3 = new javax.swing.JMenu(); jMenuItem1 = new javax.swing.JMenuItem(); jMenuItem2 = new javax.swing.JMenuItem(); jMenu4 = new javax.swing.JMenu(); jMenuItem4 = new javax.swing.JMenuItem(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jPanel1.setBackground(new java.awt.Color(0, 153, 153)); jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); jPanel1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); jPanel1.setLayout(null); jLabel2.setFont(new java.awt.Font('Tahoma', 0, 14)); // NOI18N jLabel2.setText('Name:'); jPanel1.add(jLabel2); jLabel2.setBounds(10, 10, 50, 40); jLabel3.setFont(new java.awt.Font('Tahoma', 0, 14)); // NOI18N jLabel3.setText('Number:'); jPanel1.add(jLabel3); jLabel3.setBounds(10, 50, 70, 40); tfaddress.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { tfaddressActionPerformed(evt); } }); jPanel1.add(tfaddress); tfaddress.setBounds(90, 100, 130, 30); tfname.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { tfnameActionPerformed(evt); } }); jPanel1.add(tfname); tfname.setBounds(90, 20, 130, 30); tfnumber.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { tfnumberActionPerformed(evt); } }); jPanel1.add(tfnumber); tfnumber.setBounds(90, 60, 130, 30); btnsave.setBackground(new java.awt.Color(0, 204, 204)); btnsave.setText('Save'); btnsave.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnsaveActionPerformed(evt); } }); jPanel1.add(btnsave); btnsave.setBounds(150, 150, 73, 30); jPanel2.setBackground(new java.awt.Color(153, 153, 255)); jPanel2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); jLabel1.setBackground(new java.awt.Color(153, 153, 255));
jLabel1.setFont(new java.awt.Font('Tahoma', 0, 14)); // NOI18N jLabel1.setText('Search:'); tfsearch.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { tfsearchActionPerformed(evt); } }); btnedit.setText('Edit'); btnedit.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btneditActionPerformed(evt); } }); btnshow.setText('Show'); btnshow.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnshowActionPerformed(evt); } }); btndelete.setText('Delete'); btndelete.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btndeleteActionPerformed(evt); } }); javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel2Layout.createSequentialGroup() .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 60, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(tfsearch, javax.swing.GroupLayout.PREFERRED_SIZE, 173, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() .addComponent(btndelete) .addGap(28, 28, 28) .addComponent(btnedit, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18)
.addComponent(btnshow))) .addContainerGap(27, Short.MAX_VALUE)) ); jPanel2Layout.setVerticalGroup( jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(tfsearch, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(btnedit, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(btnshow, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(btndelete, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)) .addContainerGap(20, Short.MAX_VALUE)) ); jPanel1.add(jPanel2); jPanel2.setBounds(260, 20, 290, 120); jLabel4.setFont(new java.awt.Font('Tahoma', 0, 14)); // NOI18N jLabel4.setText('Address:'); jPanel1.add(jLabel4); jLabel4.setBounds(10, 90, 70, 40); jTable1.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { }, new String [] { 'Name', 'Number', 'Address' } )); jScrollPane1.setViewportView(jTable1); jPanel1.add(jScrollPane1); jScrollPane1.setBounds(0, 230, 570, 190); btnload.setBackground(new java.awt.Color(0, 204, 204)); btnload.setText('Refresh'); btnload.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnloadActionPerformed(evt); } }); jPanel1.add(btnload); btnload.setBounds(473, 183, 80, 30);
jMenu3.setText('File'); jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_I , java.awt.event.InputEvent.CTRL_MASK)); jMenuItem1.setText('App Info'); jMenuItem1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem1ActionPerformed(evt); } }); jMenu3.add(jMenuItem1); jMenuItem2.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ A, java.awt.event.InputEvent.CTRL_MASK)); jMenuItem2.setText('About'); jMenuItem2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem2ActionPerformed(evt); } }); jMenu3.add(jMenuItem2); jMenuBar2.add(jMenu3); jMenu4.setText('Exit'); jMenuItem4.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ Q, java.awt.event.InputEvent.CTRL_MASK)); jMenuItem4.setText('Exit'); jMenuItem4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jMenuItem4ActionPerformed(evt); } }); jMenu4.add(jMenuItem4); jMenuBar2.add(jMenu4); setJMenuBar(jMenuBar2); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 572, javax.swing.GroupLayout.PREFERRED_SIZE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 416, Short.MAX_VALUE) ); pack();
}// //GEN-END:initComponents private void btnsaveActionPerformed(java.awt.event.ActionEvent evt) {//GENFIRST:event_btnsaveActionPerformed // TODO add your handling code here: try{ Class.forName('com.mysql.jdbc.Driver'); Connection conn =(Connection)DriverManager.getConnection('jdbc:mysql://localhost:3306/phonebook','root','); Statement stmt=conn.createStatement(); String d1=tfname.getText(); String d2=tfnumber.getText(); String d3=tfaddress.getText(); String sql = 'insert into book SET name='+d1+',number='+d2+',address='+d3+''; stmt.executeUpdate(sql); JOptionPane.showMessageDialog(this,'Insert Data'); stmt.close(); conn.close(); }catch(Exception e){ JOptionPane.showMessageDialog(this,' Data Not Insert !!!'); } tfname.setText('); tfnumber.setText('); tfaddress.setText('); }//GEN-LAST:event_btnsaveActionPerformed private void btnloadActionPerformed(java.awt.event.ActionEvent evt) {//GENFIRST:event_btnloadActionPerformed // TODO add your handling code here: DefaultTableModel model; model = (DefaultTableModel) jTable1.getModel(); model.setRowCount(0); try { Class.forName('com.mysql.jdbc.Driver'); Connection conn =(Connection)DriverManager.getConnection('jdbc:mysql://localhost:3306/phonebook','root','); Statement st = conn.createStatement(); String sql = 'select * from book'; ResultSet rs = st.executeQuery(sql); while (rs.next()) { model.addRow(new Object[]{rs.getString('name'), rs.getString('number'), rs.getString('address')}); } rs.close(); st.close(); conn.close(); } catch (Exception e) {
JOptionPane.showMessageDialog(this, ' Data Not Insert !!!'); } }//GEN-LAST:event_btnloadActionPerformed private void btnshowActionPerformed(java.awt.event.ActionEvent evt) {//GENFIRST:event_btnshowActionPerformed // TODO add your handling code here: try { Class.forName('com.mysql.jdbc.Driver'); Connection conn =(Connection)DriverManager.getConnection('jdbc:mysql://localhost:3306/phonebook','root','); Statement st = conn.createStatement(); String a=tfsearch.getText(); String sql = 'select * from book where name='+a+''; ResultSet rs = st.executeQuery(sql); rs.next(); tfname.setText(rs.getString('name')); tfnumber.setText(rs.getString('number')); tfaddress.setText(rs.getString('address')); search=rs.getString('id'); rs.close(); st.close(); conn.close(); } catch (Exception e) { JOptionPane.showMessageDialog(this, ' View Data !!!'); } }//GEN-LAST:event_btnshowActionPerformed private void btneditActionPerformed(java.awt.event.ActionEvent evt) {//GENFIRST:event_btneditActionPerformed // TODO add your handling code here: try{ Class.forName('com.mysql.jdbc.Driver'); Connection conn =(Connection)DriverManager.getConnection('jdbc:mysql://localhost:3306/phonebook','root','); Statement stmt=conn.createStatement(); String d4=tfsearch.getText(); String d1=tfname.getText(); String d2=tfnumber.getText(); String d3=tfaddress.getText(); String sql = 'Update book set name='+d1+', number='+d2+',address='+d3+' where name='+d4+''; stmt.executeUpdate(sql); JOptionPane.showMessageDialog(this,'Edit Data'); stmt.close(); conn.close(); }catch(Exception e){
JOptionPane.showMessageDialog(this,' Data Not Insert !!!'); } }//GEN-LAST:event_btneditActionPerformed private void btndeleteActionPerformed(java.awt.event.ActionEvent evt) {//GENFIRST:event_btndeleteActionPerformed // TODO add your handling code here: try{ Class.forName('com.mysql.jdbc.Driver'); Connection conn =(Connection)DriverManager.getConnection('jdbc:mysql://localhost:3306/phonebook','root','); Statement stmt=conn.createStatement(); String a=tfsearch.getText(); String sql = 'delete from book where name='+a+''; int P = JOptionPane.showConfirmDialog(null,' Are you sure want to delete ?','Confirmation',JOptionPane.YES_NO_OPTION); try{ if (P0){ stmt.executeUpdate(sql); JOptionPane.showMessageDialog(null, 'Record Sucessfully Deleted'); } }catch(Exception e){ JOptionPane.showMessageDialog(null, e); } stmt.close(); conn.close(); }catch(Exception e){ JOptionPane.showMessageDialog(this,' Data Not Insert !!!'); } }//GEN-LAST:event_btndeleteActionPerformed private void jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {//GENFIRST:event_jMenuItem1ActionPerformed appinfo obj = new appinfo(); obj.setVisible(true); this.setVisible(false); }//GEN-LAST:event_jMenuItem1ActionPerformed private void tfnameActionPerformed(java.awt.event.ActionEvent evt) {//GENFIRST:event_tfnameActionPerformed // TODO add your handling code here: }//GEN-LAST:event_tfnameActionPerformed private void tfsearchActionPerformed(java.awt.event.ActionEvent evt) {//GENFIRST:event_tfsearchActionPerformed // TODO add your handling code here: }//GEN-LAST:event_tfsearchActionPerformed private void tfnumberActionPerformed(java.awt.event.ActionEvent evt) {//GENFIRST:event_tfnumberActionPerformed
// TODO add your handling code here: }//GEN-LAST:event_tfnumberActionPerformed private void tfaddressActionPerformed(java.awt.event.ActionEvent evt) {//GENFIRST:event_tfaddressActionPerformed // TODO add your handling code here: }//GEN-LAST:event_tfaddressActionPerformed private void jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {//GENFIRST:event_jMenuItem4ActionPerformed // TODO add your handling code here: System.exit(0); }//GEN-LAST:event_jMenuItem4ActionPerformed private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GENFIRST:event_jMenuItem2ActionPerformed // TODO add your handling code here: about obj = new about(); obj.setVisible(true); this.setVisible(false); }//GEN-LAST:event_jMenuItem2ActionPerformed /** * @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 */ 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(Phonebook.class.getName()).log(java.util.logging.Level.SEV ERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Phonebook.class.getName()).log(java.util.logging.Level.SEV ERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Phonebook.class.getName()).log(java.util.logging.Level.SEV ERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Phonebook.class.getName()).log(java.util.logging.Level.SEV ERE, null, ex); } // /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Phonebook().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton btndelete; private javax.swing.JButton btnedit; private javax.swing.JButton btnload; private javax.swing.JButton btnsave; private javax.swing.JButton btnshow; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JMenu jMenu3; private javax.swing.JMenu jMenu4; private javax.swing.JMenuBar jMenuBar2; private javax.swing.JMenuItem jMenuItem1; private javax.swing.JMenuItem jMenuItem2; private javax.swing.JMenuItem jMenuItem4; private javax.swing.JPanel jPanel1; private javax.swing.JPanel jPanel2; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JTable jTable1; private javax.swing.JTextField tfaddress; private javax.swing.JTextField tfname; private javax.swing.JTextField tfnumber; private javax.swing.JTextField tfsearch; // End of variables declaration//GEN-END:variables }
Main class source code: package phonebook; public class Main { /** * @param args the command line arguments
*/ public static void main(String[] args) { // TODO code application logic here new Login().setVisible(true); } }
Login source code: package phonebook; import javax.swing.JOptionPane; public class Login extends javax.swing.JFrame{ /** * Creates new form Login */ public Login() { initComponents(); } @SuppressWarnings('unchecked') // <editor-fold defaultstate='collapsed' desc='Generated Code'>//GENBEGIN:initComponents private void initComponents() { jMenuItem1 = new javax.swing.JMenuItem(); jMenuItem2 = new javax.swing.JMenuItem(); jMenuItem3 = new javax.swing.JMenuItem(); jMenuItem4 = new javax.swing.JMenuItem(); jPanel1 = new javax.swing.JPanel(); jTextField1 = new javax.swing.JTextField(); jButton1 = new javax.swing.JButton(); jPasswordField1 = new javax.swing.JPasswordField(); jLabel2 = new javax.swing.JLabel(); jLabel1 = new javax.swing.JLabel(); jMenuItem1.setText('jMenuItem1'); jMenuItem2.setText('jMenuItem2'); jMenuItem3.setText('jMenuItem3'); jMenuItem4.setText('jMenuItem4'); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle('Contact Info'); setBackground(new java.awt.Color(102, 102, 255)); setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR)); jPanel1.setBackground(new java.awt.Color(102, 102, 255)); jTextField1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField1ActionPerformed(evt); }
}); jButton1.setBackground(new java.awt.Color(255, 51, 51)); jButton1.setText('Login'); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jPasswordField1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jPasswordField1ActionPerformed(evt); } }); jLabel2.setFont(new java.awt.Font('Tahoma', 1, 14)); // NOI18N jLabel2.setText('Password:'); jLabel1.setFont(new java.awt.Font('Tahoma', 1, 14)); // NOI18N jLabel1.setText('Name:'); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(168, 168, 168) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) .addComponent(jButton1) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPasswordField1, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 115, javax.swing.GroupLayout.PREFERRED_SIZE))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(75, 75, 75) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addGap(354, 354, 354))) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup()
.addGap(38, 38, 38) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(jPasswordField1, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(55, 55, 55) .addComponent(jButton1) .addContainerGap(126, Short.MAX_VALUE)) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addGap(40, 40, 40) .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(209, Short.MAX_VALUE))) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 443, Short.MAX_VALUE) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ); pack(); }// //GEN-END:initComponents private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GENFIRST:event_jButton1ActionPerformed // TODO add your handling code here: if('nuralam'.equals(jTextField1.getText()) && 'nurlyl'.equals(jPasswordField1.getText())){ new Phonebook().setVisible(true); this.setVisible(false); }else{ JOptionPane.showMessageDialog(this,'Wrong input'); } }//GEN-LAST:event_jButton1ActionPerformed private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {//GENFIRST:event_jTextField1ActionPerformed
// TODO add your handling code here: }//GEN-LAST:event_jTextField1ActionPerformed private void jPasswordField1ActionPerformed(java.awt.event.ActionEvent evt) {//GENFIRST:event_jPasswordField1ActionPerformed // TODO add your handling code here: }//GEN-LAST:event_jPasswordField1ActionPerformed /** * @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 */ 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(Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Login.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } // /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Login().setVisible(true); }
}); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton jButton1; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JMenuItem jMenuItem1; private javax.swing.JMenuItem jMenuItem2; private javax.swing.JMenuItem jMenuItem3; private javax.swing.JMenuItem jMenuItem4; private javax.swing.JPanel jPanel1; private javax.swing.JPasswordField jPasswordField1; private javax.swing.JTextField jTextField1; // End of variables declaration//GEN-END:variables }
Database Connection: add add
add
Database Connection Code: try { Class.forName('com.mysql.jdbc.Driver'); Connection conn =(Connection)DriverManager.getConnection('jdbc:mysql://localhost:3306/phonebook',' root','); Statement st = conn.createStatement(); String a=tfsearch.getText(); String sql = 'select * from book where name='+a+''; ResultSet rs = st.executeQuery(sql); rs.next(); tfname.setText(rs.getString('name')); tfnumber.setText(rs.getString('number')); tfaddress.setText(rs.getString('address')); search=rs.getString('id'); rs.close(); st.close(); conn.close(); } catch (Exception e) { JOptionPane.showMessageDialog(this, ' View Data !!!'); }
XAMPP SEVER,WAMP SERVER mysql-connector-java-5.1.26 http://dev.mysql.com/downloads/connector/j/5.1.html
connector
window Lirabraryte connector add
mysql conneCtor
mysql connector
select
add
(Run Project) Project option click
C directory Run
JCreator/NetBeans/Eclipse Program build
File Run
Open Run
Name
password Login Name: nuralam Password: nurlyl
Save (
): Name Nur-alam
Show (
Number 01737-867700
Address Muhammedpur,Dhaka
):
Show
www.bookbd.info
www.bookbd.info
www.bookbd.info
[email protected]
ACM)












































































































www.bookbd.info ক্ষ
[email protected]

Free Download Bangla Books Pdf

Free bangla book download Free Bangla Java Book. Description: Download Tutorial Java Programming Basics for Beginners, free course PDF ebook made by McGraw-Hill.

Java Bangla E Book Download

Java scripting is a browser scripting language. After knowing HTML and CSS you should learn Java Script for better performance of your work arena. Book Name: Bangla Java Script Tutorial Writer: Ferdous Alam To Download Bangla Java Script Book named Bangla Java Script Tutorial, Just Click Here! Download PDF - Object Oriented Programming Java Bangla Book on23qj3vg3l0. Jul 07, 2016 bangla book amaderpage.com bangla tutorial book from bookbd.com Skip to main content Search the history of over 377 billion web pages on the Internet. Java programming books Download our free Java programming eBooks for free and learn more about the Java language. Pm fastrack license serial number search. These books contain. Bangla Book Download Jar Files DOWNLOAD (Mirror #1) Book Online.





Coments are closed