├── README.md ├── element-list ├── loosleycoupledapp ├── bin │ ├── object.properties │ ├── GST.class │ ├── Vat.class │ ├── Busy.class │ ├── ITax.class │ ├── Tally.class │ └── TaxFactory.class └── src │ ├── object.properties │ ├── ITax.java │ ├── Vat.java │ ├── GST.java │ ├── Tally.java │ ├── Busy.java │ └── TaxFactory.java ├── Nested.java ├── gaming ├── bg.jpg ├── d1.png ├── d2.png ├── d3.png ├── ryu.png ├── bin │ └── com │ │ └── brainmentors │ │ └── gaming │ │ ├── bg.jpg │ │ ├── d1.png │ │ ├── d2.png │ │ ├── d3.png │ │ ├── ryu.png │ │ ├── Board.class │ │ ├── Enemy.class │ │ ├── camera.gif │ │ ├── Board$1.class │ │ ├── Bullet.class │ │ ├── Camera.class │ │ ├── IPlayer.class │ │ ├── Player.class │ │ ├── Sprite.class │ │ ├── ryusprite.png │ │ ├── GameFrame.class │ │ ├── ImageLoader.class │ │ └── GameConstants.class ├── src │ └── com │ │ └── brainmentors │ │ └── gaming │ │ ├── bg.jpg │ │ ├── d1.png │ │ ├── d2.png │ │ ├── d3.png │ │ ├── ryu.png │ │ ├── camera.gif │ │ ├── ryusprite.png │ │ ├── IPlayer.java │ │ ├── Enemy.java │ │ ├── Bullet.java │ │ ├── Camera.java │ │ ├── GameFrame.java │ │ ├── GameConstants.java │ │ ├── ImageLoader.java │ │ ├── Sprite.java │ │ └── Player.java ├── Enemy.java ├── GameConstants.java ├── GameFrame.java ├── ImageLoader.java ├── Player.java ├── Sprite.java └── Board.java ├── package-search-index.js ├── resources ├── x.png └── glass.png ├── demo ├── bin │ └── demo │ │ ├── A.class │ │ ├── B.class │ │ ├── Job.class │ │ ├── Demo1.class │ │ ├── Demo2.class │ │ ├── IPDemo.class │ │ ├── Account.class │ │ └── ThreadDemo.class └── src │ └── demo │ ├── IPDemo.java │ ├── Demo2.java │ ├── Demo1.java │ └── ThreadDemo.java ├── type-search-index.zip ├── member-search-index.zip ├── package-search-index.zip ├── com ├── flipkart │ └── shop │ │ └── user │ │ ├── dao │ │ ├── UserDAO.java │ │ └── Z.java │ │ ├── helper │ │ └── UserHelper.java │ │ └── views │ │ ├── A.java │ │ └── Login.java └── brainmentors │ └── gaming │ └── GameFrame.java ├── type-search-index.js ├── src └── com │ └── brainmentors │ └── gaming │ ├── bg.jpg │ ├── d1.png │ ├── d2.png │ ├── d3.png │ ├── ryu.png │ ├── camera.gif │ ├── dragon.png │ ├── Enemy.java │ ├── Bullet.java │ ├── Camera.java │ ├── GameFrame.java │ ├── GameConstants.java │ ├── ImageLoader.java │ ├── Player.java │ └── Sprite.java ├── billing ├── mysql-connector-java-8.0.15.jar ├── bin │ └── com │ │ └── brainmentors │ │ └── billing │ │ ├── user │ │ ├── login.png │ │ ├── Login.class │ │ └── UserDAO.class │ │ └── utils │ │ └── CommonDAO.class └── src │ └── com │ └── brainmentors │ └── billing │ ├── user │ ├── login.png │ ├── UserDAO.java │ └── Login.java │ └── utils │ └── CommonDAO.java ├── jquery ├── images │ ├── ui-icons_222222_256x240.png │ ├── ui-icons_2e83ff_256x240.png │ ├── ui-icons_454545_256x240.png │ ├── ui-icons_888888_256x240.png │ ├── ui-icons_cd0a0a_256x240.png │ ├── ui-bg_glass_55_fbf9ee_1x400.png │ ├── ui-bg_glass_65_dadada_1x400.png │ ├── ui-bg_glass_75_dadada_1x400.png │ ├── ui-bg_glass_75_e6e6e6_1x400.png │ ├── ui-bg_glass_95_fef1ec_1x400.png │ └── ui-bg_highlight-soft_75_cccccc_1x100.png ├── jszip-utils │ └── dist │ │ ├── jszip-utils-ie.min.js │ │ ├── jszip-utils.min.js │ │ └── jszip-utils-ie.js ├── jquery-ui.structure.min.css └── jquery-ui.structure.css ├── v2 └── src │ └── com │ └── brainmentors │ └── billing │ ├── main │ ├── intro.jpg │ ├── DashBoard.java │ └── IntroScreen.java │ ├── user │ ├── login.png │ ├── UserDAO.java │ └── Register.java │ └── utils │ └── CommonDAO.java ├── v3 └── src │ ├── com │ └── brainmentors │ │ └── billing │ │ ├── main │ │ ├── intro.jpg │ │ ├── IntroScreen.java │ │ └── DashBoard.java │ │ ├── user │ │ ├── login.png │ │ ├── UserDAO.java │ │ └── Register.java │ │ ├── utils │ │ ├── ConfigReader.java │ │ ├── ExcelReader.java │ │ └── CommonDAO.java │ │ └── model │ │ └── Product.java │ └── config.properties ├── v4 └── src │ ├── com │ └── brainmentors │ │ └── billing │ │ ├── main │ │ ├── intro.jpg │ │ ├── pepsi.png │ │ ├── pizza.jpg │ │ ├── burger.jpg │ │ ├── IntroScreen.java │ │ └── DashBoard.java │ │ ├── user │ │ ├── login.png │ │ ├── UserDAO.java │ │ └── Register.java │ │ ├── utils │ │ ├── ConfigReader.java │ │ ├── CommonDAO.java │ │ └── ExcelReader.java │ │ └── model │ │ ├── Product.java │ │ └── ProductDAO.java │ └── config.properties ├── v5 └── src │ ├── com │ └── brainmentors │ │ └── billing │ │ ├── main │ │ ├── intro.jpg │ │ ├── pepsi.png │ │ ├── pizza.jpg │ │ ├── burger.jpg │ │ ├── ViewCart.java │ │ ├── IntroScreen.java │ │ └── DashBoard.java │ │ ├── user │ │ ├── login.png │ │ ├── UserDAO.java │ │ └── Register.java │ │ ├── utils │ │ ├── ConfigReader.java │ │ ├── MailSender.java │ │ ├── CommonDAO.java │ │ └── ExcelReader.java │ │ └── model │ │ ├── Product.java │ │ ├── ProductTableModel.java │ │ └── ProductDAO.java │ ├── config.properties │ └── log4j.properties ├── member-search-index.js ├── TestEmployee.java ├── StringRef.java ├── IPlayer.java ├── GCDemo.java ├── A.java ├── Pool.java ├── InterfaceDemo.java ├── Demo.java ├── CheckedDemo.java ├── FirstClass.java ├── FirstDemo.java ├── ISADemo4.java ├── Java8Interface.java ├── exceptiondemo ├── Demo2.java ├── ThrowsThrow.java └── Demo.java ├── ScannerDemo.java ├── index.html ├── TypePromotionRule.java ├── StringUtil.java ├── IfElse.java ├── OwnExceptionDemo.java ├── HeapDemo.java ├── Formatting.java ├── ISADemo3.java ├── AbstractClassDemo.java ├── FinalDemo.java ├── SingletonDemo.java ├── ISADemo.java ├── ThrowsThrow.java ├── StaticDemo.java ├── Data.java ├── Employee.java ├── OverrideRule.java ├── DataTypes.java ├── TestStudent.java ├── InterfaceUseWays.java ├── ISADemo2.java ├── SwitchCaseDemo.java ├── Student.java ├── deprecated-list.html ├── constant-values.html ├── overview-tree.html └── package-tree.html /README.md: -------------------------------------------------------------------------------- 1 | # corejavareg -------------------------------------------------------------------------------- /element-list: -------------------------------------------------------------------------------- 1 | unnamed package 2 | -------------------------------------------------------------------------------- /loosleycoupledapp/bin/object.properties: -------------------------------------------------------------------------------- 1 | classname=GST -------------------------------------------------------------------------------- /loosleycoupledapp/src/object.properties: -------------------------------------------------------------------------------- 1 | classname=GST -------------------------------------------------------------------------------- /Nested.java: -------------------------------------------------------------------------------- 1 | class A{ 2 | class B{ 3 | 4 | } 5 | } -------------------------------------------------------------------------------- /gaming/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/gaming/bg.jpg -------------------------------------------------------------------------------- /gaming/d1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/gaming/d1.png -------------------------------------------------------------------------------- /gaming/d2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/gaming/d2.png -------------------------------------------------------------------------------- /gaming/d3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/gaming/d3.png -------------------------------------------------------------------------------- /gaming/ryu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/gaming/ryu.png -------------------------------------------------------------------------------- /loosleycoupledapp/src/ITax.java: -------------------------------------------------------------------------------- 1 | 2 | public interface ITax { 3 | public void tax(); 4 | } 5 | -------------------------------------------------------------------------------- /package-search-index.js: -------------------------------------------------------------------------------- 1 | packageSearchIndex = [{"l":"All Packages","url":"allpackages-index.html"}] -------------------------------------------------------------------------------- /resources/x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/resources/x.png -------------------------------------------------------------------------------- /demo/bin/demo/A.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/demo/bin/demo/A.class -------------------------------------------------------------------------------- /demo/bin/demo/B.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/demo/bin/demo/B.class -------------------------------------------------------------------------------- /resources/glass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/resources/glass.png -------------------------------------------------------------------------------- /type-search-index.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/type-search-index.zip -------------------------------------------------------------------------------- /demo/bin/demo/Job.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/demo/bin/demo/Job.class -------------------------------------------------------------------------------- /member-search-index.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/member-search-index.zip -------------------------------------------------------------------------------- /demo/bin/demo/Demo1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/demo/bin/demo/Demo1.class -------------------------------------------------------------------------------- /demo/bin/demo/Demo2.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/demo/bin/demo/Demo2.class -------------------------------------------------------------------------------- /demo/bin/demo/IPDemo.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/demo/bin/demo/IPDemo.class -------------------------------------------------------------------------------- /package-search-index.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/package-search-index.zip -------------------------------------------------------------------------------- /com/flipkart/shop/user/dao/UserDAO.java: -------------------------------------------------------------------------------- 1 | package com.flipkart.shop.user.dao; 2 | 3 | public class UserDAO { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /demo/bin/demo/Account.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/demo/bin/demo/Account.class -------------------------------------------------------------------------------- /type-search-index.js: -------------------------------------------------------------------------------- 1 | typeSearchIndex = [{"l":"All Classes","url":"allclasses-index.html"},{"p":"","l":"FirstDemo"}] -------------------------------------------------------------------------------- /demo/bin/demo/ThreadDemo.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/demo/bin/demo/ThreadDemo.class -------------------------------------------------------------------------------- /loosleycoupledapp/bin/GST.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/loosleycoupledapp/bin/GST.class -------------------------------------------------------------------------------- /loosleycoupledapp/bin/Vat.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/loosleycoupledapp/bin/Vat.class -------------------------------------------------------------------------------- /loosleycoupledapp/bin/Busy.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/loosleycoupledapp/bin/Busy.class -------------------------------------------------------------------------------- /loosleycoupledapp/bin/ITax.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/loosleycoupledapp/bin/ITax.class -------------------------------------------------------------------------------- /loosleycoupledapp/bin/Tally.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/loosleycoupledapp/bin/Tally.class -------------------------------------------------------------------------------- /src/com/brainmentors/gaming/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/src/com/brainmentors/gaming/bg.jpg -------------------------------------------------------------------------------- /src/com/brainmentors/gaming/d1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/src/com/brainmentors/gaming/d1.png -------------------------------------------------------------------------------- /src/com/brainmentors/gaming/d2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/src/com/brainmentors/gaming/d2.png -------------------------------------------------------------------------------- /src/com/brainmentors/gaming/d3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/src/com/brainmentors/gaming/d3.png -------------------------------------------------------------------------------- /src/com/brainmentors/gaming/ryu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/src/com/brainmentors/gaming/ryu.png -------------------------------------------------------------------------------- /loosleycoupledapp/bin/TaxFactory.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/loosleycoupledapp/bin/TaxFactory.class -------------------------------------------------------------------------------- /src/com/brainmentors/gaming/camera.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/src/com/brainmentors/gaming/camera.gif -------------------------------------------------------------------------------- /src/com/brainmentors/gaming/dragon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/src/com/brainmentors/gaming/dragon.png -------------------------------------------------------------------------------- /billing/mysql-connector-java-8.0.15.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/billing/mysql-connector-java-8.0.15.jar -------------------------------------------------------------------------------- /com/flipkart/shop/user/dao/Z.java: -------------------------------------------------------------------------------- 1 | package com.flipkart.shop.user.dao; 2 | 3 | public class Z { 4 | protected int a; 5 | int b; 6 | 7 | } 8 | -------------------------------------------------------------------------------- /gaming/bin/com/brainmentors/gaming/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/gaming/bin/com/brainmentors/gaming/bg.jpg -------------------------------------------------------------------------------- /gaming/bin/com/brainmentors/gaming/d1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/gaming/bin/com/brainmentors/gaming/d1.png -------------------------------------------------------------------------------- /gaming/bin/com/brainmentors/gaming/d2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/gaming/bin/com/brainmentors/gaming/d2.png -------------------------------------------------------------------------------- /gaming/bin/com/brainmentors/gaming/d3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/gaming/bin/com/brainmentors/gaming/d3.png -------------------------------------------------------------------------------- /gaming/src/com/brainmentors/gaming/bg.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/gaming/src/com/brainmentors/gaming/bg.jpg -------------------------------------------------------------------------------- /gaming/src/com/brainmentors/gaming/d1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/gaming/src/com/brainmentors/gaming/d1.png -------------------------------------------------------------------------------- /gaming/src/com/brainmentors/gaming/d2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/gaming/src/com/brainmentors/gaming/d2.png -------------------------------------------------------------------------------- /gaming/src/com/brainmentors/gaming/d3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/gaming/src/com/brainmentors/gaming/d3.png -------------------------------------------------------------------------------- /jquery/images/ui-icons_222222_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/jquery/images/ui-icons_222222_256x240.png -------------------------------------------------------------------------------- /jquery/images/ui-icons_2e83ff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/jquery/images/ui-icons_2e83ff_256x240.png -------------------------------------------------------------------------------- /jquery/images/ui-icons_454545_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/jquery/images/ui-icons_454545_256x240.png -------------------------------------------------------------------------------- /jquery/images/ui-icons_888888_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/jquery/images/ui-icons_888888_256x240.png -------------------------------------------------------------------------------- /jquery/images/ui-icons_cd0a0a_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/jquery/images/ui-icons_cd0a0a_256x240.png -------------------------------------------------------------------------------- /gaming/bin/com/brainmentors/gaming/ryu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/gaming/bin/com/brainmentors/gaming/ryu.png -------------------------------------------------------------------------------- /gaming/src/com/brainmentors/gaming/ryu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/gaming/src/com/brainmentors/gaming/ryu.png -------------------------------------------------------------------------------- /gaming/bin/com/brainmentors/gaming/Board.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/gaming/bin/com/brainmentors/gaming/Board.class -------------------------------------------------------------------------------- /gaming/bin/com/brainmentors/gaming/Enemy.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/gaming/bin/com/brainmentors/gaming/Enemy.class -------------------------------------------------------------------------------- /gaming/bin/com/brainmentors/gaming/camera.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/gaming/bin/com/brainmentors/gaming/camera.gif -------------------------------------------------------------------------------- /gaming/src/com/brainmentors/gaming/camera.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/gaming/src/com/brainmentors/gaming/camera.gif -------------------------------------------------------------------------------- /jquery/images/ui-bg_glass_55_fbf9ee_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/jquery/images/ui-bg_glass_55_fbf9ee_1x400.png -------------------------------------------------------------------------------- /jquery/images/ui-bg_glass_65_dadada_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/jquery/images/ui-bg_glass_65_dadada_1x400.png -------------------------------------------------------------------------------- /jquery/images/ui-bg_glass_75_dadada_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/jquery/images/ui-bg_glass_75_dadada_1x400.png -------------------------------------------------------------------------------- /jquery/images/ui-bg_glass_75_e6e6e6_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/jquery/images/ui-bg_glass_75_e6e6e6_1x400.png -------------------------------------------------------------------------------- /jquery/images/ui-bg_glass_95_fef1ec_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/jquery/images/ui-bg_glass_95_fef1ec_1x400.png -------------------------------------------------------------------------------- /v2/src/com/brainmentors/billing/main/intro.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/v2/src/com/brainmentors/billing/main/intro.jpg -------------------------------------------------------------------------------- /v2/src/com/brainmentors/billing/user/login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/v2/src/com/brainmentors/billing/user/login.png -------------------------------------------------------------------------------- /v3/src/com/brainmentors/billing/main/intro.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/v3/src/com/brainmentors/billing/main/intro.jpg -------------------------------------------------------------------------------- /v3/src/com/brainmentors/billing/user/login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/v3/src/com/brainmentors/billing/user/login.png -------------------------------------------------------------------------------- /v4/src/com/brainmentors/billing/main/intro.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/v4/src/com/brainmentors/billing/main/intro.jpg -------------------------------------------------------------------------------- /v4/src/com/brainmentors/billing/main/pepsi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/v4/src/com/brainmentors/billing/main/pepsi.png -------------------------------------------------------------------------------- /v4/src/com/brainmentors/billing/main/pizza.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/v4/src/com/brainmentors/billing/main/pizza.jpg -------------------------------------------------------------------------------- /v4/src/com/brainmentors/billing/user/login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/v4/src/com/brainmentors/billing/user/login.png -------------------------------------------------------------------------------- /v5/src/com/brainmentors/billing/main/intro.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/v5/src/com/brainmentors/billing/main/intro.jpg -------------------------------------------------------------------------------- /v5/src/com/brainmentors/billing/main/pepsi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/v5/src/com/brainmentors/billing/main/pepsi.png -------------------------------------------------------------------------------- /v5/src/com/brainmentors/billing/main/pizza.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/v5/src/com/brainmentors/billing/main/pizza.jpg -------------------------------------------------------------------------------- /v5/src/com/brainmentors/billing/user/login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/v5/src/com/brainmentors/billing/user/login.png -------------------------------------------------------------------------------- /gaming/bin/com/brainmentors/gaming/Board$1.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/gaming/bin/com/brainmentors/gaming/Board$1.class -------------------------------------------------------------------------------- /gaming/bin/com/brainmentors/gaming/Bullet.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/gaming/bin/com/brainmentors/gaming/Bullet.class -------------------------------------------------------------------------------- /gaming/bin/com/brainmentors/gaming/Camera.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/gaming/bin/com/brainmentors/gaming/Camera.class -------------------------------------------------------------------------------- /gaming/bin/com/brainmentors/gaming/IPlayer.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/gaming/bin/com/brainmentors/gaming/IPlayer.class -------------------------------------------------------------------------------- /gaming/bin/com/brainmentors/gaming/Player.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/gaming/bin/com/brainmentors/gaming/Player.class -------------------------------------------------------------------------------- /gaming/bin/com/brainmentors/gaming/Sprite.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/gaming/bin/com/brainmentors/gaming/Sprite.class -------------------------------------------------------------------------------- /gaming/bin/com/brainmentors/gaming/ryusprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/gaming/bin/com/brainmentors/gaming/ryusprite.png -------------------------------------------------------------------------------- /gaming/src/com/brainmentors/gaming/ryusprite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/gaming/src/com/brainmentors/gaming/ryusprite.png -------------------------------------------------------------------------------- /v4/src/com/brainmentors/billing/main/burger.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/v4/src/com/brainmentors/billing/main/burger.jpg -------------------------------------------------------------------------------- /v5/src/com/brainmentors/billing/main/burger.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/v5/src/com/brainmentors/billing/main/burger.jpg -------------------------------------------------------------------------------- /billing/bin/com/brainmentors/billing/user/login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/billing/bin/com/brainmentors/billing/user/login.png -------------------------------------------------------------------------------- /billing/src/com/brainmentors/billing/user/login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/billing/src/com/brainmentors/billing/user/login.png -------------------------------------------------------------------------------- /gaming/bin/com/brainmentors/gaming/GameFrame.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/gaming/bin/com/brainmentors/gaming/GameFrame.class -------------------------------------------------------------------------------- /billing/bin/com/brainmentors/billing/user/Login.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/billing/bin/com/brainmentors/billing/user/Login.class -------------------------------------------------------------------------------- /gaming/bin/com/brainmentors/gaming/ImageLoader.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/gaming/bin/com/brainmentors/gaming/ImageLoader.class -------------------------------------------------------------------------------- /billing/bin/com/brainmentors/billing/user/UserDAO.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/billing/bin/com/brainmentors/billing/user/UserDAO.class -------------------------------------------------------------------------------- /gaming/bin/com/brainmentors/gaming/GameConstants.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/gaming/bin/com/brainmentors/gaming/GameConstants.class -------------------------------------------------------------------------------- /jquery/images/ui-bg_highlight-soft_75_cccccc_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/jquery/images/ui-bg_highlight-soft_75_cccccc_1x100.png -------------------------------------------------------------------------------- /billing/bin/com/brainmentors/billing/utils/CommonDAO.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amitsrivastava4all/corejavareg/HEAD/billing/bin/com/brainmentors/billing/utils/CommonDAO.class -------------------------------------------------------------------------------- /gaming/src/com/brainmentors/gaming/IPlayer.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.gaming; 2 | 3 | public interface IPlayer { 4 | int KICK = 1; 5 | int PUNCH = 2; 6 | int MOVE = 3; 7 | } 8 | -------------------------------------------------------------------------------- /v3/src/config.properties: -------------------------------------------------------------------------------- 1 | browsepath=/Users/amit/Documents 2 | userid=root 3 | password=amit123456 4 | dburl=jdbc:mysql://localhost:3306/billingdb 5 | driver=com.mysql.cj.jdbc.Driver -------------------------------------------------------------------------------- /v4/src/config.properties: -------------------------------------------------------------------------------- 1 | browsepath=/Users/amit/Documents 2 | userid=root 3 | password=amit123456 4 | dburl=jdbc:mysql://localhost:3306/billingdb 5 | driver=com.mysql.cj.jdbc.Driver -------------------------------------------------------------------------------- /v5/src/config.properties: -------------------------------------------------------------------------------- 1 | browsepath=/Users/amit/Documents 2 | userid=root 3 | password=amit123456 4 | dburl=jdbc:mysql://localhost:3306/billingdb 5 | driver=com.mysql.cj.jdbc.Driver -------------------------------------------------------------------------------- /com/flipkart/shop/user/helper/UserHelper.java: -------------------------------------------------------------------------------- 1 | package com.flipkart.shop.user.helper; 2 | 3 | public class UserHelper { 4 | public boolean isBlank() { 5 | return true; 6 | } 7 | 8 | } 9 | -------------------------------------------------------------------------------- /loosleycoupledapp/src/Vat.java: -------------------------------------------------------------------------------- 1 | 2 | public class Vat implements ITax{ 3 | 4 | @Override 5 | public void tax() { 6 | System.out.println("Vat Tax "); 7 | 8 | } 9 | 10 | } 11 | -------------------------------------------------------------------------------- /member-search-index.js: -------------------------------------------------------------------------------- 1 | memberSearchIndex = [{"p":"","c":"FirstDemo","l":"FirstDemo()","url":"%3Cinit%3E()"},{"p":"","c":"FirstDemo","l":"main(String[])","url":"main(java.lang.String[])"}] -------------------------------------------------------------------------------- /loosleycoupledapp/src/GST.java: -------------------------------------------------------------------------------- 1 | 2 | public class GST implements ITax{ 3 | @Override 4 | public void tax() { 5 | System.out.println("GST Tax "); 6 | 7 | } 8 | void types() { 9 | System.out.println("Types of tax"); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /com/flipkart/shop/user/views/A.java: -------------------------------------------------------------------------------- 1 | package com.flipkart.shop.user.views; 2 | 3 | import com.flipkart.shop.user.dao.Z; 4 | 5 | public class A extends Z { 6 | void show() { 7 | System.out.println(super.a); 8 | //System.out.println(super.b); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /TestEmployee.java: -------------------------------------------------------------------------------- 1 | import java.math.BigDecimal; 2 | 3 | public class TestEmployee { 4 | 5 | public static void main(String[] args) { 6 | // TODO Auto-generated method stub 7 | Employee emp = new Employee(1001, "Ram", new BigDecimal("100000000")); 8 | System.out.println(emp.printReport()); 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /com/flipkart/shop/user/views/Login.java: -------------------------------------------------------------------------------- 1 | package com.flipkart.shop.user.views; 2 | 3 | import com.flipkart.shop.user.helper.UserHelper; 4 | 5 | public class Login { 6 | 7 | public static void main(String[] args) { 8 | // TODO Auto-generated method stub 9 | UserHelper helper = new UserHelper(); 10 | 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /StringRef.java: -------------------------------------------------------------------------------- 1 | class StringRef{ 2 | public static void main(String args[]){ 3 | int x= 100; 4 | int y = 100; 5 | System.out.println(x==y); 6 | 7 | String name = "Amit"; 8 | String name3 = "Amit"; 9 | String name2 = new String("Amit"); 10 | System.out.println(name==name3); 11 | System.out.println(name==name2); 12 | } 13 | } -------------------------------------------------------------------------------- /IPlayer.java: -------------------------------------------------------------------------------- 1 | //public abstract interface IPlayer{ 2 | public interface IPlayer { 3 | //int MAX_JUMP = 100; 4 | public static final int MAX_JUMP = 100; 5 | void jump(); 6 | void run(); 7 | //public abstract void jump(); 8 | } 9 | interface IStarPlayer{ 10 | public static final int MAX_JUMP = 200; 11 | void powerWithTime(); 12 | } 13 | interface HybridPlayer extends IPlayer,IStarPlayer { 14 | 15 | } -------------------------------------------------------------------------------- /gaming/Enemy.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.gaming; 2 | 3 | import java.awt.image.BufferedImage; 4 | 5 | public class Enemy extends Sprite implements GameConstants{ 6 | boolean outOfScreen = false; 7 | public Enemy(int x, BufferedImage image, int speed) { 8 | this.h = this.w = 100; 9 | this.y = FLOOR - h; 10 | this.image = image; 11 | this.x = x; 12 | this.speed = speed; 13 | 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /GCDemo.java: -------------------------------------------------------------------------------- 1 | class A5{ 2 | 3 | } 4 | public class GCDemo { 5 | 6 | public static void main(String[] args) { 7 | // TODO Auto-generated method stub 8 | A5 obj = new A5(); 9 | obj = null; // Eligable GC 10 | if(10>2) { 11 | A5 obj2 = new A5(); 12 | } // after i obj2 is eligable for G.C 13 | A5 obj3 = new A5(); 14 | A5 obj4 = new A5(); 15 | obj3 = obj4; // Reassign eligiable for G.C 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/com/brainmentors/gaming/Enemy.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.gaming; 2 | 3 | import java.awt.image.BufferedImage; 4 | 5 | public class Enemy extends Sprite implements GameConstants{ 6 | boolean outOfScreen = false; 7 | public Enemy(int x, BufferedImage image, int speed) { 8 | this.h = this.w = 100; 9 | this.y = FLOOR - h; 10 | this.image = image; 11 | this.x = x; 12 | this.speed = speed; 13 | 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /gaming/src/com/brainmentors/gaming/Enemy.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.gaming; 2 | 3 | import java.awt.image.BufferedImage; 4 | 5 | public class Enemy extends Sprite implements GameConstants{ 6 | boolean outOfScreen = false; 7 | public Enemy(int x, BufferedImage image, int speed) { 8 | this.h = this.w = 100; 9 | this.y = FLOOR - h; 10 | this.image = image; 11 | this.x = x; 12 | this.speed = speed; 13 | 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /A.java: -------------------------------------------------------------------------------- 1 | class B{ 2 | private int x; 3 | private void hra() { 4 | 5 | } 6 | private void da() { 7 | 8 | } 9 | void print() { 10 | 11 | } 12 | public void salarySlip() { 13 | hra(); 14 | da(); 15 | } 16 | } 17 | public class A { 18 | 19 | public static void main(String[] args) { 20 | // TODO Auto-generated method stub 21 | B b = new B(); 22 | b.salarySlip(); 23 | 24 | //b.x =100; 25 | 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/com/brainmentors/gaming/Bullet.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.gaming; 2 | 3 | import java.awt.Color; 4 | import java.awt.Graphics; 5 | 6 | public class Bullet extends Sprite implements GameConstants { 7 | public Bullet(int x, int y) { 8 | this.x = x; 9 | this.y = y; 10 | this.w = this.h = 10; 11 | this.speed = 20; 12 | } 13 | public void drawBullet(Graphics g) { 14 | g.setColor(Color.BLACK); 15 | g.fillOval(x, y, w, h); 16 | move(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /gaming/src/com/brainmentors/gaming/Bullet.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.gaming; 2 | 3 | import java.awt.Color; 4 | import java.awt.Graphics; 5 | 6 | public class Bullet extends Sprite implements GameConstants { 7 | public Bullet(int x, int y) { 8 | this.x = x; 9 | this.y = y; 10 | this.w = this.h = 10; 11 | this.speed = 20; 12 | } 13 | public void drawBullet(Graphics g) { 14 | g.setColor(Color.BLACK); 15 | g.fillOval(x, y, w, h); 16 | move(); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Pool.java: -------------------------------------------------------------------------------- 1 | class Pool{ 2 | public static void main(String[] args) { 3 | Character c = 'A'; 4 | 5 | String name = "Amit"; 6 | name.charAt(index) 7 | String name2 ="Amit"; 8 | String name3 = new String("Amit"); 9 | System.out.println(name==name2); 10 | System.out.println(name==name3); 11 | Integer q = 128; 12 | Integer q1 = 128; 13 | System.out.println(q==q1); 14 | 15 | } 16 | } -------------------------------------------------------------------------------- /com/brainmentors/gaming/GameFrame.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.gaming; 2 | 3 | import javax.swing.JFrame; 4 | 5 | public class GameFrame extends JFrame { 6 | public GameFrame() { 7 | setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 8 | 9 | setSize(900,600); 10 | setTitle("Game-2019"); 11 | setResizable(false); 12 | //setLocation(200, 100); 13 | setVisible(true); 14 | } 15 | 16 | public static void main(String[] args) { 17 | new GameFrame(); 18 | 19 | 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /v3/src/com/brainmentors/billing/utils/ConfigReader.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.billing.utils; 2 | 3 | import java.util.ResourceBundle; 4 | 5 | public interface ConfigReader { 6 | String BROWSE_PATH = "browsepath"; 7 | String USERID = "userid"; 8 | String PWD = "password"; 9 | String DBURL ="dburl"; 10 | String DRIVER = "driver"; 11 | ResourceBundle rb = ResourceBundle.getBundle("config"); 12 | public static String getValue(String key) { 13 | return rb.getString(key); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /v4/src/com/brainmentors/billing/utils/ConfigReader.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.billing.utils; 2 | 3 | import java.util.ResourceBundle; 4 | 5 | public interface ConfigReader { 6 | String BROWSE_PATH = "browsepath"; 7 | String USERID = "userid"; 8 | String PWD = "password"; 9 | String DBURL ="dburl"; 10 | String DRIVER = "driver"; 11 | ResourceBundle rb = ResourceBundle.getBundle("config"); 12 | public static String getValue(String key) { 13 | return rb.getString(key); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /v5/src/com/brainmentors/billing/utils/ConfigReader.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.billing.utils; 2 | 3 | import java.util.ResourceBundle; 4 | 5 | public interface ConfigReader { 6 | String BROWSE_PATH = "browsepath"; 7 | String USERID = "userid"; 8 | String PWD = "password"; 9 | String DBURL ="dburl"; 10 | String DRIVER = "driver"; 11 | ResourceBundle rb = ResourceBundle.getBundle("config"); 12 | public static String getValue(String key) { 13 | return rb.getString(key); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /loosleycoupledapp/src/Tally.java: -------------------------------------------------------------------------------- 1 | import java.lang.reflect.InvocationTargetException; 2 | 3 | public class Tally { 4 | 5 | public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException { 6 | // TODO Auto-generated method stub 7 | // ITax tax = new GST(); 8 | // tax.tax(); 9 | ITax tax = TaxFactory.getTax(); 10 | tax.tax(); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /v5/src/log4j.properties: -------------------------------------------------------------------------------- 1 | # Root logger option 2 | log4j.rootLogger=ERROR, file 3 | 4 | 5 | # Redirect log messages to a log file, support file rolling. 6 | log4j.appender.file=org.apache.log4j.RollingFileAppender 7 | log4j.appender.file.File=/Users/amit/Documents/logs/app.log 8 | log4j.appender.file.MaxFileSize=5MB 9 | log4j.appender.file.MaxBackupIndex=10 10 | log4j.appender.file.layout=org.apache.log4j.PatternLayout 11 | log4j.appender.file.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n 12 | -------------------------------------------------------------------------------- /gaming/GameConstants.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.gaming; 2 | 3 | public interface GameConstants { 4 | int GHEIGHT = 500; 5 | int GWIDTH = 900; 6 | String TITLE = "Game-2019"; 7 | String BACKGROUND_IMAGE = "bg.jpg"; 8 | int FLOOR = GHEIGHT-130; 9 | String PLAYER_IMG = "ryu.png"; 10 | String ENEMY_IMG1 = "d1.png"; 11 | String ENEMY_IMG2 = "d2.png"; 12 | String ENEMY_IMG3 = "d3.png"; 13 | int GRAVITY = 2; 14 | int DEFAULT_FORCE = -20; 15 | int DELAY = 10; 16 | int MAX_ENEMIES = 3; 17 | int ENEMY_POS = GWIDTH + 100; 18 | 19 | } 20 | -------------------------------------------------------------------------------- /InterfaceDemo.java: -------------------------------------------------------------------------------- 1 | class Honda implements IPlayer{ 2 | @Override 3 | public void jump() { 4 | System.out.println("Short Jump"); 5 | } 6 | @Override 7 | public void run() { 8 | 9 | } 10 | } 11 | class Ryu implements IPlayer{ 12 | @Override 13 | public void jump() { 14 | System.out.println("Big Jump"); 15 | } 16 | @Override 17 | public void run() { 18 | 19 | } 20 | } 21 | public class InterfaceDemo { 22 | 23 | public static void main(String[] args) { 24 | // TODO Auto-generated method stub 25 | 26 | 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/com/brainmentors/gaming/Camera.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.gaming; 2 | 3 | import java.awt.Graphics; 4 | import java.awt.image.BufferedImage; 5 | 6 | public class Camera extends Sprite implements GameConstants{ 7 | public Camera() { 8 | x = 0; 9 | y = 0; 10 | w = GWIDTH; 11 | h= GHEIGHT; 12 | speed = 10; 13 | image = ImageLoader.loadImage(CAMERA_IMAGE); 14 | } 15 | public void drawCamera(Graphics g) { 16 | BufferedImage subImage = image.getSubimage(x, y, GWIDTH, GHEIGHT); 17 | g.drawImage(subImage,0,0,GWIDTH, GHEIGHT,null); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /gaming/src/com/brainmentors/gaming/Camera.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.gaming; 2 | 3 | import java.awt.Graphics; 4 | import java.awt.image.BufferedImage; 5 | 6 | public class Camera extends Sprite implements GameConstants{ 7 | public Camera() { 8 | x = 0; 9 | y = 0; 10 | w = GWIDTH; 11 | h= GHEIGHT; 12 | speed = 10; 13 | image = ImageLoader.loadImage(CAMERA_IMAGE); 14 | } 15 | public void drawCamera(Graphics g) { 16 | BufferedImage subImage = image.getSubimage(x, y, GWIDTH, GHEIGHT); 17 | g.drawImage(subImage,0,0,GWIDTH, GHEIGHT,null); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /loosleycoupledapp/src/Busy.java: -------------------------------------------------------------------------------- 1 | import java.lang.reflect.InvocationTargetException; 2 | 3 | public class Busy { 4 | 5 | public static void main(String[] args) throws ClassNotFoundException, InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException { 6 | // TODO Auto-generated method stub 7 | // GST gst = new GST(); 8 | // gst.tax(); 9 | // gst.types(); 10 | // ITax tax = new GST(); 11 | // tax.tax(); 12 | ITax tax = TaxFactory.getTax(); 13 | tax.tax(); 14 | //tax.types(); 15 | 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /Demo.java: -------------------------------------------------------------------------------- 1 | class Add{ 2 | //static int count; 3 | public static void main(int x){ 4 | System.out.println("My Main Method"); 5 | } 6 | static public void main(String args[]){ 7 | int sum = 0; 8 | for(int i = 0; i0){ 16 | for(int i = 0 ; i2) { 14 | System.exit(0); 15 | //return ; 16 | } 17 | //name.length(); 18 | // if(name!=null) { 19 | // name.length(); 20 | // } 21 | System.out.println("2. QUERY"); 22 | System.out.println("3. Fetch"); 23 | } 24 | catch(NullPointerException e) { 25 | System.out.println("Something went wrong contact to System admin"); 26 | } 27 | finally { 28 | System.out.println("DB Connection Close"); 29 | } 30 | 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /gaming/Player.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.gaming; 2 | 3 | import java.awt.Graphics; 4 | import java.awt.image.BufferedImage; 5 | 6 | public class Player extends Sprite implements GameConstants { 7 | 8 | private int force; 9 | private boolean isJumped; 10 | public Player() { 11 | isJumped = false; 12 | speed = 5; 13 | x = 100; 14 | h = w = 100; 15 | y = FLOOR - h; 16 | image= ImageLoader.loadImage(PLAYER_IMG); 17 | 18 | } 19 | 20 | 21 | public void jump() { 22 | if(!isJumped) { 23 | force = DEFAULT_FORCE; 24 | y = y + force; 25 | isJumped = true; 26 | } 27 | } 28 | 29 | public void fall() { 30 | if(y>=FLOOR-h) { 31 | isJumped = false; 32 | y = FLOOR - h; 33 | } 34 | else { 35 | force = force + GRAVITY; 36 | y = y + force; 37 | } 38 | } 39 | 40 | 41 | 42 | 43 | 44 | } 45 | -------------------------------------------------------------------------------- /ScannerDemo.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | 3 | //import java.lang.*; 4 | 5 | class ScannerDemo{ 6 | public static void main(String[] args) { 7 | 8 | Scanner scanner = new Scanner("Hello how are You\n I am good\n Hi There"); 9 | int wordCount = 0; 10 | int lineCount = 0; 11 | while(scanner.hasNext()){ 12 | String line = scanner.nextLine(); 13 | lineCount++; 14 | System.out.println(line.trim()); 15 | // String word = scanner.next(); 16 | 17 | // if(word.toUpperCase().startsWith("H") ){ 18 | // wordCount++; 19 | // } 20 | // current and move to next 21 | // System.out.println("Word is "+word); 22 | } 23 | System.out.println(lineCount); 24 | // System.out.println(wordCount); 25 | } 26 | } -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Generated Documentation (Untitled) 7 | 8 | 9 | 10 | 13 | 14 | 15 | 16 | 17 |
18 | 21 |

FirstDemo.html

22 |
23 | 24 | 25 | -------------------------------------------------------------------------------- /TypePromotionRule.java: -------------------------------------------------------------------------------- 1 | class Ty{ 2 | // void show(Integer x) { 3 | // System.out.println("Integer"); 4 | // } 5 | void show(Long x) { 6 | System.out.println("Long"); 7 | } 8 | // void show(int ...x) { // 1.5 9 | // System.out.println("int var args"); 10 | // } 11 | void show(byte x) { 12 | System.out.println("byte "); 13 | } 14 | void show(short x) { 15 | System.out.println("short"); 16 | } 17 | /*void show(int x) { 18 | System.out.println("int"); 19 | }*/ 20 | // void show(long x) { 21 | // System.out.println("long"); 22 | // } 23 | // void show(float x) { 24 | // System.out.println("float"); 25 | // } 26 | } 27 | public class TypePromotionRule { 28 | 29 | public static void main(String[] args) { 30 | // TODO Auto-generated method stub 31 | Ty t = new Ty(); 32 | //t.show(10); 33 | //t.show((byte)10); 34 | 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /StringUtil.java: -------------------------------------------------------------------------------- 1 | 2 | public class StringUtil { 3 | 4 | private StringUtil(){ 5 | 6 | } 7 | // public static void main(String[] args) { 8 | // StringUtil sb = new StringUtil(); 9 | // System.out.println(sb.titleCase("rAm kUmAR sHARma")); 10 | // } 11 | public static String titleCase(String str) { 12 | String fullName =""; 13 | if(str!=null && str.trim().length()>0) { 14 | String strArr [] = str.split(" "); 15 | for(String st : strArr) { 16 | fullName += String.valueOf(st.charAt(0)).toUpperCase() 17 | + st.substring(1).toLowerCase()+" "; 18 | // char ch = st.charAt(0); 19 | // String ch2 = String.valueOf(ch); 20 | // ch2 = ch2.toUpperCase(); 21 | // String subString = st.substring(1); 22 | // subString = subString.toLowerCase(); 23 | // fullName += ch2 + subString+ " "; 24 | } 25 | } 26 | return fullName; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /IfElse.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | 3 | class IfElse{ 4 | 5 | public static void main(String[] args) { 6 | int a ; 7 | int b ; 8 | Scanner scanner = new Scanner(System.in); 9 | 10 | 11 | System.out.println("Enter the First Number"); 12 | a = scanner.nextInt(); //nextXXX(); 13 | System.out.println("Enter the Second Number"); 14 | b = scanner.nextInt(); 15 | scanner.nextLine(); 16 | scanner.close(); 17 | scanner = new Scanner(System.in); 18 | System.out.println("Enter the name"); 19 | String name = scanner.nextLine(); 20 | System.out.println("Name is "+name); 21 | if(a>b){ 22 | System.out.println("A is Greater"); 23 | } 24 | else{ 25 | System.out.println("B is Greater"); 26 | } 27 | 28 | // while(true){ 29 | 30 | // } 31 | } 32 | } -------------------------------------------------------------------------------- /OwnExceptionDemo.java: -------------------------------------------------------------------------------- 1 | package exceptiondemo; 2 | 3 | import java.util.Scanner; 4 | // class MinorAgeException extends RuntimeException // UnChecked 5 | class MinorAgeException extends Exception{ // Checked 6 | 7 | @Override 8 | public String toString() { 9 | return "Can't Apply for DL and VoterId card Age is Minor"; 10 | } 11 | 12 | } 13 | public class OwnExceptionDemo { 14 | 15 | public static void main(String[] args) { 16 | // TODO Auto-generated method stub 17 | System.out.println("Enter the Age"); 18 | int age = new Scanner(System.in).nextInt(); 19 | try { 20 | if(age<18) { 21 | throw new MinorAgeException(); 22 | } 23 | System.out.println("U can Apply for DL "); 24 | System.out.println("U Can Apply for VoterId"); 25 | } 26 | catch(MinorAgeException ex) { 27 | System.out.println(ex); 28 | //System.out.println(ex.toString()); 29 | //System.out.println("Can't Apply for DL and VoterId card Age is Minor"); 30 | } 31 | 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /demo/src/demo/Demo2.java: -------------------------------------------------------------------------------- 1 | package demo; 2 | class Account implements Runnable{ 3 | int i =1 ; 4 | int amount = 5000; 5 | @Override 6 | //public synchronized void run() { 7 | public void run() { 8 | for(int j=1 ; j<=5; j++) { 9 | synchronized (this) { 10 | if(j==5 && amount>=5000 ) { 11 | amount = amount - 5000; 12 | } 13 | i++; 14 | } 15 | 16 | System.out.println("Amount "+amount+"I is "+i+" J is " 17 | +j+" Name "+Thread.currentThread().getName()); 18 | } 19 | } 20 | } 21 | public class Demo2 { 22 | 23 | public static void main(String[] args) throws InterruptedException { 24 | Account a = new Account(); 25 | Thread ram =new Thread(a,"ram"); 26 | Thread shyam =new Thread(a,"shyam"); 27 | Thread mike =new Thread(a,"mike"); 28 | Thread tim =new Thread(a,"tim"); 29 | ram.start(); 30 | System.out.println(ram.isAlive()); 31 | ram.join(); 32 | shyam.start(); 33 | mike.start(); 34 | tim.start(); 35 | 36 | 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /HeapDemo.java: -------------------------------------------------------------------------------- 1 | import java.util.ArrayList; 2 | 3 | class MyCustomer{ 4 | long id; 5 | String name; 6 | MyCustomer(long id , String name){ 7 | this.id = id; 8 | this.name = name; 9 | } 10 | } 11 | public class HeapDemo { 12 | void add(int x, double y) { 13 | 14 | } 15 | void add(int x, int y) { 16 | 17 | } 18 | void add(double x, int y) { 19 | 20 | } 21 | void add(int x, int y, int z) { 22 | 23 | } 24 | 25 | public static void main(String[] args) throws InterruptedException { 26 | // TODO Auto-generated method stub 27 | long startTime = System.currentTimeMillis(); 28 | for(int i = 1;i<=100000;i++) { 29 | 30 | } 31 | long endTime = System.currentTimeMillis(); 32 | System.out.println(endTime-startTime); 33 | ArrayList l = new ArrayList(); 34 | long a = 1; 35 | System.out.println("Program Start"); 36 | while(true) { 37 | MyCustomer obj = new MyCustomer(a,"Ram"+a); 38 | l.add(obj); 39 | Thread.sleep(50); 40 | 41 | } 42 | 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /Formatting.java: -------------------------------------------------------------------------------- 1 | import java.math.BigDecimal; 2 | import java.text.DateFormat; 3 | import java.text.NumberFormat; 4 | import java.util.Date; 5 | import java.util.Locale; 6 | 7 | public class Formatting { 8 | // public static void main(String[] args) { 9 | // System.out.println(dateFormat()); 10 | // } 11 | private Formatting() {} 12 | public static String currencyFormat(BigDecimal bg) { 13 | Locale locale =new Locale("fr", "FR"); 14 | NumberFormat nf = NumberFormat.getCurrencyInstance(locale); 15 | return nf.format(bg.doubleValue()); 16 | } 17 | public static String dateFormat() { 18 | Date date = new Date(); 19 | Locale locale =new Locale("fr", "FR"); 20 | DateFormat df = DateFormat. 21 | getDateInstance(DateFormat.FULL, locale); 22 | //System.out.println("Date is "+date); 23 | return df.format(date); 24 | //return null; 25 | // Locale locale =new Locale("fr", "FR"); 26 | // NumberFormat nf = NumberFormat.getCurrencyInstance(locale); 27 | // return nf.format(bg.doubleValue()); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /ISADemo3.java: -------------------------------------------------------------------------------- 1 | class A{ 2 | int x; 3 | A(){ 4 | this(100); 5 | x = 100; 6 | System.out.println("A Cons call"); 7 | } 8 | A(int x){ 9 | //this(); 10 | System.out.println("A Param Cons Call"); 11 | } 12 | } 13 | class B extends A{ 14 | int x; 15 | int y ; 16 | B(){ 17 | //super(10); 18 | x = 200; 19 | y = 9999; 20 | System.out.println("B Cons call"); 21 | } 22 | B(int x){ 23 | this(); 24 | //super(10); 25 | System.out.println("B Param Cons Call"); 26 | } 27 | } 28 | class C extends B{ 29 | int x; 30 | C(){ 31 | super(20); 32 | 33 | // Implicit Super constructor call 34 | //super(); // Call to parent default cons 35 | x = 300 + y; 36 | System.out.println("C Cons call"); 37 | } 38 | C(int x){ 39 | this(); 40 | //super(200); 41 | // super(); 42 | System.out.println("C Param Cons Call"); 43 | } 44 | } 45 | public class ISADemo3 { 46 | 47 | public static void main(String[] args) { 48 | C c = new C(100); 49 | // TODO Auto-generated method stub 50 | 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /v3/src/com/brainmentors/billing/model/Product.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.billing.model; 2 | 3 | public class Product { 4 | private int id; 5 | private String name; 6 | private String desc; 7 | private double price; 8 | private String path; 9 | private int quantity; 10 | public int getId() { 11 | return id; 12 | } 13 | public void setId(int id) { 14 | this.id = id; 15 | } 16 | public String getName() { 17 | return name; 18 | } 19 | public void setName(String name) { 20 | this.name = name; 21 | } 22 | public String getDesc() { 23 | return desc; 24 | } 25 | public void setDesc(String desc) { 26 | this.desc = desc; 27 | } 28 | public double getPrice() { 29 | return price; 30 | } 31 | public void setPrice(double price) { 32 | this.price = price; 33 | } 34 | public String getPath() { 35 | return path; 36 | } 37 | public void setPath(String path) { 38 | this.path = path; 39 | } 40 | public int getQuantity() { 41 | return quantity; 42 | } 43 | public void setQuantity(int quantity) { 44 | this.quantity = quantity; 45 | } 46 | 47 | 48 | } 49 | -------------------------------------------------------------------------------- /v4/src/com/brainmentors/billing/model/Product.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.billing.model; 2 | 3 | public class Product { 4 | private int id; 5 | private String name; 6 | private String desc; 7 | private double price; 8 | private String path; 9 | private int quantity; 10 | public int getId() { 11 | return id; 12 | } 13 | public void setId(int id) { 14 | this.id = id; 15 | } 16 | public String getName() { 17 | return name; 18 | } 19 | public void setName(String name) { 20 | this.name = name; 21 | } 22 | public String getDesc() { 23 | return desc; 24 | } 25 | public void setDesc(String desc) { 26 | this.desc = desc; 27 | } 28 | public double getPrice() { 29 | return price; 30 | } 31 | public void setPrice(double price) { 32 | this.price = price; 33 | } 34 | public String getPath() { 35 | return path; 36 | } 37 | public void setPath(String path) { 38 | this.path = path; 39 | } 40 | public int getQuantity() { 41 | return quantity; 42 | } 43 | public void setQuantity(int quantity) { 44 | this.quantity = quantity; 45 | } 46 | 47 | 48 | } 49 | -------------------------------------------------------------------------------- /v5/src/com/brainmentors/billing/model/Product.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.billing.model; 2 | 3 | public class Product { 4 | private int id; 5 | private String name; 6 | private String desc; 7 | private double price; 8 | private String path; 9 | private int quantity; 10 | public int getId() { 11 | return id; 12 | } 13 | public void setId(int id) { 14 | this.id = id; 15 | } 16 | public String getName() { 17 | return name; 18 | } 19 | public void setName(String name) { 20 | this.name = name; 21 | } 22 | public String getDesc() { 23 | return desc; 24 | } 25 | public void setDesc(String desc) { 26 | this.desc = desc; 27 | } 28 | public double getPrice() { 29 | return price; 30 | } 31 | public void setPrice(double price) { 32 | this.price = price; 33 | } 34 | public String getPath() { 35 | return path; 36 | } 37 | public void setPath(String path) { 38 | this.path = path; 39 | } 40 | public int getQuantity() { 41 | return quantity; 42 | } 43 | public void setQuantity(int quantity) { 44 | this.quantity = quantity; 45 | } 46 | 47 | 48 | } 49 | -------------------------------------------------------------------------------- /v2/src/com/brainmentors/billing/main/DashBoard.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.billing.main; 2 | 3 | import java.awt.BorderLayout; 4 | import java.awt.EventQueue; 5 | 6 | import javax.swing.JFrame; 7 | import javax.swing.JPanel; 8 | import javax.swing.border.EmptyBorder; 9 | import javax.swing.JLabel; 10 | import java.awt.Font; 11 | import java.awt.Color; 12 | 13 | public class DashBoard extends JFrame { 14 | 15 | private JPanel contentPane; 16 | 17 | 18 | 19 | 20 | 21 | /** 22 | * Create the frame. 23 | */ 24 | public DashBoard(String userid) { 25 | setTitle("DASHBOARD"); 26 | setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 27 | setBounds(100, 100, 450, 300); 28 | contentPane = new JPanel(); 29 | contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); 30 | setContentPane(contentPane); 31 | contentPane.setLayout(null); 32 | 33 | JLabel welcomelbl = new JLabel("Welcome "+userid); 34 | welcomelbl.setForeground(Color.RED); 35 | welcomelbl.setFont(new Font("Lucida Grande", Font.BOLD, 18)); 36 | welcomelbl.setBounds(22, 6, 264, 39); 37 | contentPane.add(welcomelbl); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /AbstractClassDemo.java: -------------------------------------------------------------------------------- 1 | abstract class Insurance{ 2 | int x; 3 | int y ; 4 | //static final int z; 5 | Insurance(){ 6 | x = 100; 7 | y = 200; 8 | // z = 1000; 9 | } 10 | void withDraw() { 11 | System.out.println("X is "+x+" and y is "+y); 12 | } 13 | abstract void mature(); 14 | abstract void pay(); 15 | } 16 | class LifeInsurance extends Insurance{ 17 | 18 | @Override 19 | void pay() { 20 | // TODO Auto-generated method stub 21 | 22 | } 23 | 24 | @Override 25 | void mature() { 26 | // TODO Auto-generated method stub 27 | 28 | } 29 | 30 | } 31 | abstract class AccInsurance extends Insurance{ 32 | @Override 33 | void pay() { 34 | // TODO Auto-generated method stub 35 | 36 | } 37 | } 38 | class HdfcAccInsurance extends AccInsurance{ 39 | @Override 40 | void mature() { 41 | // TODO Auto-generated method stub 42 | 43 | } 44 | } 45 | 46 | public class AbstractClassDemo { 47 | 48 | public static void main(String[] args) { 49 | // TODO Auto-generated method stub 50 | //Insurance insurance = new Insurance(); 51 | LifeInsurance l = new LifeInsurance(); 52 | 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /FinalDemo.java: -------------------------------------------------------------------------------- 1 | class Z{ 2 | void disp() { 3 | if(10>2) { 4 | 5 | } 6 | } 7 | } 8 | 9 | class Y{ 10 | //final int W = 100; 11 | final int W ; 12 | Y(){ 13 | W = 100; 14 | } 15 | // void show() { 16 | // W = 100; 17 | // } 18 | 19 | } 20 | class X{ 21 | int a, b; 22 | X(){ 23 | a = 100; 24 | b = 200; 25 | } 26 | } 27 | class Loan{ 28 | private final void applyForLoan() { 29 | System.out.println("Apply For Loan"); 30 | } 31 | } 32 | class HomeLoan extends Loan{ 33 | //@Override 34 | void applyForLoan() { 35 | 36 | } 37 | } 38 | //final class Math{ 39 | // void sin() { 40 | // 41 | // } 42 | // void cos() { 43 | // 44 | // } 45 | // void tan() { 46 | // 47 | // } 48 | //} 49 | public class FinalDemo { 50 | 51 | public static void main(String[] args) { 52 | // TODO Auto-generated method stub 53 | final int EE = 100; 54 | //EE = 100; 55 | final int []t = new int[10]; 56 | t[0]= 10000; 57 | 58 | final int MAX = 100; 59 | final X obj = new X(); 60 | obj.a++; 61 | obj.b++; 62 | System.out.println(obj.a+" "+obj.b); 63 | 64 | //obj = new X(); 65 | Math.sin(90); 66 | System.out.println(); 67 | 68 | } 69 | 70 | } 71 | -------------------------------------------------------------------------------- /SingletonDemo.java: -------------------------------------------------------------------------------- 1 | import java.text.NumberFormat; 2 | 3 | class Printer{ 4 | private static Printer printer; // null 5 | private Printer(){} 6 | void show() { 7 | System.out.println("CAll Show"); 8 | } 9 | public static Printer getInstance() { 10 | if(printer == null) { 11 | printer = new Printer(); 12 | } 13 | return printer; 14 | } 15 | } 16 | public class SingletonDemo { 17 | 18 | public static void main(String[] args) { 19 | //Printer p1 = new Printer(); 20 | //NumberFormat nf = NumberFormat.getCurrencyInstance(); 21 | Printer printer1= Printer.getInstance(); 22 | printer1.show(); 23 | Printer printer2= Printer.getInstance(); 24 | Printer printer3= Printer.getInstance(); 25 | Printer printer4= Printer.getInstance(); 26 | Printer printer5= Printer.getInstance(); 27 | if(printer1 == printer2 && printer1==printer3) { 28 | System.out.println("Same"); 29 | } 30 | else { 31 | System.out.println("Not Same"); 32 | } 33 | // Printer p1 = new Printer(); 34 | // Printer p2 = new Printer(); 35 | // Printer p3 = new Printer(); 36 | // Printer p4 = new Printer(); 37 | // Printer p5 = new Printer(); 38 | 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /billing/src/com/brainmentors/billing/user/UserDAO.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.billing.user; 2 | 3 | import java.sql.Connection; 4 | import java.sql.ResultSet; 5 | import java.sql.SQLException; 6 | import java.sql.Statement; 7 | 8 | import com.brainmentors.billing.utils.CommonDAO; 9 | 10 | public class UserDAO { 11 | public boolean loginCheck(String uid, String pwd) throws ClassNotFoundException, SQLException { 12 | //String uid = "amit"; 13 | //String pwd = "78979"; 14 | ResultSet rs = null; 15 | Connection con = null; 16 | Statement stmt = null; 17 | try { 18 | con = CommonDAO.getConnection(); 19 | 20 | stmt = con.createStatement(); 21 | rs = stmt.executeQuery("select userid " 22 | + "from user_mst where " 23 | + "userid='"+uid+"' and " 24 | + "password='"+pwd+"'"); 25 | System.out.println("Userid is "+uid); 26 | if(rs.next()) { 27 | return true; 28 | //System.out.println("Welcome "+uid); 29 | } 30 | else { 31 | return false; 32 | //System.out.println("Invalid Userid or Password"); 33 | } 34 | } 35 | finally { 36 | rs.close(); 37 | stmt.close(); 38 | //con.close(); 39 | } 40 | 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /demo/src/demo/Demo1.java: -------------------------------------------------------------------------------- 1 | package demo; 2 | 3 | import java.lang.reflect.InvocationTargetException; 4 | import java.lang.reflect.Method; 5 | import java.util.Scanner; 6 | 7 | class A{ 8 | public A(){ 9 | System.out.println("A Cons call"); 10 | } 11 | void show() { 12 | System.out.println("Show"); 13 | } 14 | } 15 | class B{ 16 | public B(){ 17 | System.out.println("B Cons Call"); 18 | } 19 | void print() { 20 | System.out.println("Print"); 21 | } 22 | } 23 | public class Demo1 { 24 | 25 | public static void main(String[] args) throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException, SecurityException, ClassNotFoundException { 26 | // TODO Auto-generated method stub 27 | System.out.println("Enter the Class Name to Load"); 28 | Scanner scanner = new Scanner(System.in); 29 | String className = scanner.next(); 30 | Object object = Class.forName(className).getConstructor().newInstance(); 31 | System.out.println("Method Name to be Call"); 32 | String methodName = scanner.next(); 33 | Method method = object.getClass().getDeclaredMethod(methodName); 34 | method.invoke(object); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/com/brainmentors/gaming/Player.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.gaming; 2 | 3 | import java.util.ArrayList; 4 | 5 | public class Player extends Sprite implements GameConstants { 6 | private ArrayList bullets = new ArrayList<>(); 7 | private int force; 8 | private boolean isJumped; 9 | public Player() { 10 | isJumped = false; 11 | speed = 5; 12 | x = 100; 13 | h = w = 100; 14 | y = FLOOR - h; 15 | image= ImageLoader.loadImage(PLAYER_IMG); 16 | 17 | } 18 | 19 | public ArrayList getBullets() { 20 | return bullets; 21 | } 22 | 23 | public void setBullets(ArrayList bullets) { 24 | this.bullets = bullets; 25 | } 26 | 27 | public void fire() { 28 | Bullet bullet = new Bullet((x+this.getW()/2+10), (y+(this.getH()/2-30))); 29 | bullets.add(bullet); 30 | } 31 | 32 | public void jump() { 33 | if(!isJumped) { 34 | force = DEFAULT_FORCE; 35 | y = y + force; 36 | isJumped = true; 37 | } 38 | } 39 | 40 | public void fall() { 41 | if(y>=FLOOR-h) { 42 | isJumped = false; 43 | y = FLOOR - h; 44 | } 45 | else { 46 | force = force + GRAVITY; 47 | y = y + force; 48 | } 49 | } 50 | 51 | 52 | 53 | 54 | 55 | } 56 | -------------------------------------------------------------------------------- /gaming/Sprite.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.gaming; 2 | 3 | import java.awt.Graphics; 4 | import java.awt.image.BufferedImage; 5 | 6 | public abstract class Sprite { 7 | protected int x; 8 | protected int y; 9 | protected int w; 10 | protected int h; 11 | protected int speed; 12 | protected BufferedImage image; 13 | public void draw(Graphics g) { 14 | g.drawImage(image, x,y,w,h,null); 15 | } 16 | public void move() { 17 | x+=speed; 18 | //System.out.println("X is "+x); 19 | } 20 | public int getX() { 21 | return x; 22 | } 23 | 24 | public void setX(int x) { 25 | this.x = x; 26 | } 27 | 28 | public int getY() { 29 | return y; 30 | } 31 | 32 | public void setY(int y) { 33 | this.y = y; 34 | } 35 | 36 | public int getW() { 37 | return w; 38 | } 39 | 40 | public void setW(int w) { 41 | this.w = w; 42 | } 43 | 44 | public int getH() { 45 | return h; 46 | } 47 | 48 | public void setH(int h) { 49 | this.h = h; 50 | } 51 | 52 | public int getSpeed() { 53 | return speed; 54 | } 55 | 56 | public void setSpeed(int speed) { 57 | this.speed = speed; 58 | } 59 | 60 | public BufferedImage getImage() { 61 | return image; 62 | } 63 | 64 | public void setImage(BufferedImage image) { 65 | this.image = image; 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /ISADemo.java: -------------------------------------------------------------------------------- 1 | class Account{ 2 | double balance; 3 | int id; 4 | String name; 5 | void deposit() { 6 | System.out.println("Account Deposit"); 7 | } 8 | void withDraw() { 9 | System.out.println("Account WithDraw"); 10 | } 11 | void roi() { 12 | System.out.println("4% ROI"); 13 | } 14 | } 15 | class SavingAccount extends Account { 16 | @Override 17 | void deposit() { 18 | System.out.println("WithDraw Need Pan Card > 50K"); 19 | } 20 | void transLimit() { 21 | System.out.println("Trans Limit"); 22 | } 23 | } 24 | class CurrentAccount extends Account{ 25 | 26 | @Override 27 | public void roi() { 28 | 29 | System.out.println("5% ROI"); 30 | super.roi(); 31 | } 32 | void odLimit() { 33 | System.out.println("Od Limit"); 34 | } 35 | } 36 | class CorpAccount extends CurrentAccount{ 37 | 38 | } 39 | public class ISADemo { 40 | 41 | public static void main(String[] args) { 42 | // TODO Auto-generated method stub 43 | SavingAccount sa = new SavingAccount(); 44 | sa.deposit(); 45 | sa.withDraw(); 46 | sa.transLimit(); 47 | sa.roi(); 48 | System.out.println("********************************"); 49 | CurrentAccount ca = new CurrentAccount(); 50 | ca.deposit(); 51 | ca.withDraw(); 52 | ca.odLimit(); 53 | ca.roi(); 54 | 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /src/com/brainmentors/gaming/Sprite.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.gaming; 2 | 3 | import java.awt.Graphics; 4 | import java.awt.image.BufferedImage; 5 | 6 | public abstract class Sprite { 7 | protected int x; 8 | protected int y; 9 | protected int w; 10 | protected int h; 11 | protected int speed; 12 | protected BufferedImage image; 13 | public void draw(Graphics g) { 14 | g.drawImage(image, x,y,w,h,null); 15 | } 16 | public void move() { 17 | x+=speed; 18 | //System.out.println("X is "+x); 19 | } 20 | public int getX() { 21 | return x; 22 | } 23 | 24 | public void setX(int x) { 25 | this.x = x; 26 | } 27 | 28 | public int getY() { 29 | return y; 30 | } 31 | 32 | public void setY(int y) { 33 | this.y = y; 34 | } 35 | 36 | public int getW() { 37 | return w; 38 | } 39 | 40 | public void setW(int w) { 41 | this.w = w; 42 | } 43 | 44 | public int getH() { 45 | return h; 46 | } 47 | 48 | public void setH(int h) { 49 | this.h = h; 50 | } 51 | 52 | public int getSpeed() { 53 | return speed; 54 | } 55 | 56 | public void setSpeed(int speed) { 57 | this.speed = speed; 58 | } 59 | 60 | public BufferedImage getImage() { 61 | return image; 62 | } 63 | 64 | public void setImage(BufferedImage image) { 65 | this.image = image; 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /gaming/src/com/brainmentors/gaming/Sprite.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.gaming; 2 | 3 | import java.awt.Graphics; 4 | import java.awt.image.BufferedImage; 5 | 6 | public abstract class Sprite { 7 | protected int x; 8 | protected int y; 9 | protected int w; 10 | protected int h; 11 | protected int speed; 12 | protected BufferedImage image; 13 | public void draw(Graphics g) { 14 | g.drawImage(image, x,y,w,h,null); 15 | } 16 | public void move() { 17 | x+=speed; 18 | //System.out.println("X is "+x); 19 | } 20 | public int getX() { 21 | return x; 22 | } 23 | 24 | public void setX(int x) { 25 | this.x = x; 26 | } 27 | 28 | public int getY() { 29 | return y; 30 | } 31 | 32 | public void setY(int y) { 33 | this.y = y; 34 | } 35 | 36 | public int getW() { 37 | return w; 38 | } 39 | 40 | public void setW(int w) { 41 | this.w = w; 42 | } 43 | 44 | public int getH() { 45 | return h; 46 | } 47 | 48 | public void setH(int h) { 49 | this.h = h; 50 | } 51 | 52 | public int getSpeed() { 53 | return speed; 54 | } 55 | 56 | public void setSpeed(int speed) { 57 | this.speed = speed; 58 | } 59 | 60 | public BufferedImage getImage() { 61 | return image; 62 | } 63 | 64 | public void setImage(BufferedImage image) { 65 | this.image = image; 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /v5/src/com/brainmentors/billing/model/ProductTableModel.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.billing.model; 2 | 3 | import java.util.ArrayList; 4 | 5 | import javax.swing.table.AbstractTableModel; 6 | 7 | public class ProductTableModel extends AbstractTableModel{ 8 | ArrayList products; 9 | String cols [] = {"S.No","PROD NAME", "PRICE", "QTY", "DESC"}; 10 | public ProductTableModel(ArrayList products){ 11 | this.products= products; 12 | } 13 | @Override 14 | public int getRowCount() { 15 | // TODO Auto-generated method stub 16 | return products.size(); 17 | } 18 | 19 | @Override 20 | public int getColumnCount() { 21 | // TODO Auto-generated method stub 22 | return cols.length; 23 | } 24 | 25 | @Override 26 | public Object getValueAt(int rowIndex, int columnIndex) { 27 | // TODO Auto-generated method stub 28 | System.out.println("getValueAt "+rowIndex+" Col "+columnIndex); 29 | if(columnIndex==0) { 30 | return products.get(rowIndex).getId(); 31 | } 32 | 33 | if(columnIndex==1) { 34 | return products.get(rowIndex).getName(); 35 | } 36 | if(columnIndex==2) { 37 | return products.get(rowIndex).getPrice(); 38 | } 39 | if(columnIndex==3) { 40 | return products.get(rowIndex).getQuantity(); 41 | } 42 | if(columnIndex==4) { 43 | return products.get(rowIndex).getDesc(); 44 | } 45 | return null; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /exceptiondemo/ThrowsThrow.java: -------------------------------------------------------------------------------- 1 | package exceptiondemo; 2 | 3 | public class ThrowsThrow { 4 | static void db() throws ArithmeticException { 5 | try { 6 | System.out.println("Open DB"); 7 | System.out.println("Query"); 8 | int e = 100/0; // throw new ArithmeticException(); 9 | } 10 | finally { 11 | System.out.println("Close DB"); 12 | } 13 | } 14 | static void helper() throws ArithmeticException { 15 | System.out.println("I am in Helper calling DB"); 16 | db(); 17 | System.out.println("Helper Ends"); 18 | } 19 | static void view() { 20 | try { 21 | System.out.println("I am in View Calling Helper"); 22 | helper(); 23 | System.out.println("View Ends"); 24 | } 25 | catch(ArithmeticException e) { 26 | System.out.println("SOMe DB Problem occur "); 27 | } 28 | } 29 | public static void main(String[] args) { 30 | // TODO Auto-generated method stub 31 | view(); 32 | try { 33 | String name = null; 34 | name.toUpperCase(); // NullPointor 35 | int x = 100/0; // Arithmetic 36 | int y [] = new int [5]; 37 | y[50] =100; 38 | 39 | } 40 | catch(NullPointerException e) { 41 | System.out.println("Values not coming"); 42 | } 43 | catch(ArithmeticException e) { 44 | System.out.println("Divide a no with zero"); 45 | } 46 | catch(ArrayIndexOutOfBoundsException e) { 47 | System.out.println("exced the range"); 48 | } 49 | catch(Exception e) { 50 | System.out.println("Contact to System Admin"); 51 | } 52 | 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /ThrowsThrow.java: -------------------------------------------------------------------------------- 1 | package exceptiondemo; 2 | 3 | public class ThrowsThrow { 4 | static void db() throws ArithmeticException { 5 | try { 6 | System.out.println("Open DB"); 7 | System.out.println("Query"); 8 | int e = 100/0; // throw new ArithmeticException(); 9 | } 10 | finally { 11 | System.out.println("Close DB"); 12 | } 13 | } 14 | static void helper() throws ArithmeticException { 15 | System.out.println("I am in Helper calling DB"); 16 | db(); 17 | System.out.println("Helper Ends"); 18 | } 19 | static void view() { 20 | try { 21 | System.out.println("I am in View Calling Helper"); 22 | helper(); 23 | System.out.println("View Ends"); 24 | } 25 | catch(ArithmeticException e) { 26 | System.out.println("SOMe DB Problem occur "); 27 | e.printStackTrace(); 28 | } 29 | } 30 | public static void main(String[] args) { 31 | // TODO Auto-generated method stub 32 | view(); 33 | /*try { 34 | String name = null; 35 | name.toUpperCase(); // NullPointor 36 | int x = 100/0; // Arithmetic 37 | int y [] = new int [5]; 38 | y[50] =100; 39 | 40 | } 41 | catch(NullPointerException e) { 42 | System.out.println("Values not coming"); 43 | } 44 | catch(ArithmeticException e) { 45 | System.out.println("Divide a no with zero"); 46 | } 47 | catch(ArrayIndexOutOfBoundsException e) { 48 | System.out.println("exced the range"); 49 | } 50 | catch(Exception e) { 51 | System.out.println("Contact to System Admin"); 52 | }*/ 53 | 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /StaticDemo.java: -------------------------------------------------------------------------------- 1 | import static java.lang.System.in; 2 | import static java.lang.System.out; 3 | 4 | 5 | import java.util.Scanner; 6 | 7 | // Utility Interface 8 | interface Validation{ 9 | 10 | static void emailCheck() { 11 | 12 | } 13 | static void phoneCheck() { 14 | 15 | } 16 | } 17 | 18 | // Utility Class 19 | //final class Validation{ 20 | // private Validation() {} 21 | // static void emailCheck() { 22 | // 23 | // } 24 | // static void phoneCheck() { 25 | // 26 | // } 27 | //} 28 | class Emp{ 29 | int id ; 30 | String name; 31 | //int counter; 32 | static int counter; 33 | static void print() { 34 | out.println("I am Static Print"); 35 | } 36 | static { 37 | counter = 1000 + 90 - 100; 38 | counter = counter * 12; 39 | //id = 100; 40 | out.println("I call during class load"); 41 | } 42 | static { 43 | out.println("Static 2"); 44 | } 45 | 46 | { 47 | out.println("Init Block"); 48 | } 49 | { 50 | out.println("init block2"); 51 | } 52 | Emp(int id , String name){ 53 | this.id = id; 54 | this.name = name; 55 | counter++; 56 | out.println("Cons Counter is "+counter); 57 | } 58 | } 59 | public class StaticDemo { 60 | 61 | public static void main(String[] args) { 62 | // TODO Auto-generated method stub 63 | Scanner s = new Scanner(in); 64 | Validation.emailCheck(); 65 | Emp.print(); 66 | Emp ram = new Emp(1001,"Ram"); 67 | Emp shyam = new Emp(1002,"Shyam"); 68 | Emp tom = new Emp(1003,"Tom"); 69 | out.println(Emp.counter); 70 | 71 | 72 | } 73 | 74 | } 75 | -------------------------------------------------------------------------------- /Data.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | class MyClass{ 4 | 5 | } 6 | class Data{ 7 | public static void main(String[] args) { 8 | MyClass cls = new MyClass(); 9 | String msg1 = "Welcome User"; 10 | String msg2 = "Welcome User"; 11 | String msg3 = "Welcome User"; 12 | String msg4 = "Welcome User"; 13 | String msg5 = "Welcome User"; 14 | String msg6 = "Welcome User"; 15 | System.out.println(msg1==msg6); 16 | msg6 = "Bye User"; 17 | System.out.println(msg1==msg6); 18 | System.out.println("#############################"); 19 | // ClassName@ 20 | // MyClass@HashCode(HexaDecimal) 21 | System.out.println(cls.toString()); 22 | String name = "Amit".intern(); // 1 or 0 23 | String name2 = "Amit".intern(); 24 | String name3 = new String("Amit").intern(); // 2 or 1 25 | System.out.println(name==name2); //true 26 | System.out.println(name==name3); 27 | System.out.println("*************************"); 28 | 29 | int x1 = 10; 30 | int y1 = 10; 31 | System.out.println(x1==y1); //true 32 | System.out.println(name); 33 | System.out.println(name.toString()); 34 | 35 | boolean flag = true; 36 | char tt = 'A'; 37 | String str = "नमस्ते"; // char [] 38 | int x =100000; 39 | long w = 123L; 40 | float q1 = 90.20f; 41 | double q2 = 90.44; 42 | byte q = (byte)130; 43 | System.out.println(str); 44 | 45 | } 46 | } -------------------------------------------------------------------------------- /v3/src/com/brainmentors/billing/utils/ExcelReader.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.billing.utils; 2 | 3 | import java.io.File; 4 | import java.io.FileInputStream; 5 | import java.io.IOException; 6 | import java.util.ArrayList; 7 | import java.util.Iterator; 8 | 9 | import org.apache.poi.hssf.usermodel.HSSFSheet; 10 | import org.apache.poi.hssf.usermodel.HSSFWorkbook; 11 | import org.apache.poi.ss.usermodel.Cell; 12 | import org.apache.poi.ss.usermodel.CellType; 13 | import org.apache.poi.ss.usermodel.Row; 14 | 15 | import com.brainmentors.billing.model.Product; 16 | 17 | 18 | public interface ExcelReader { 19 | 20 | public static ArrayList readXLS(File file) throws IOException { 21 | ArrayList productList = new ArrayList<>(); 22 | if(!file.exists()) { 23 | return null; 24 | } 25 | FileInputStream fs = new FileInputStream(file); 26 | HSSFWorkbook workBook = new HSSFWorkbook(fs); 27 | HSSFSheet sheet = workBook.getSheetAt(9); 28 | Iterator rows = sheet.rowIterator(); 29 | while(rows.hasNext()) { 30 | Row currentRow = rows.next(); 31 | Iterator cells = currentRow.cellIterator(); 32 | while(cells.hasNext()) { 33 | Cell currentCell = cells.next(); 34 | if(currentCell.getCellType()==CellType.STRING) { 35 | System.out.println(currentCell.getStringCellValue()); 36 | } 37 | else 38 | if(currentCell.getCellType()==CellType.NUMERIC) { 39 | System.out.println(currentCell.getNumericCellValue()); 40 | } 41 | } 42 | } 43 | workBook.close(); 44 | fs.close(); 45 | return productList; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /Employee.java: -------------------------------------------------------------------------------- 1 | import java.math.BigDecimal; 2 | 3 | public class Employee { 4 | private int id; 5 | private String name; 6 | private BigDecimal salary; 7 | private String companyName; 8 | public String printReport() { 9 | return "Date is "+Formatting.dateFormat()+"\nId "+id+ "Name "+name+"\n"+ 10 | "Basic Salary "+Formatting.currencyFormat(salary)+"\n"+ 11 | "HRA "+Formatting.currencyFormat(hra())+"\n"+ 12 | "DA "+Formatting.currencyFormat(da())+"\n"+ 13 | "GS "+Formatting.currencyFormat(gs()); 14 | } 15 | private BigDecimal gs() { 16 | return salary.add(hra()).add(da()); 17 | } 18 | private BigDecimal hra() { 19 | BigDecimal hraValue = new BigDecimal("0.30"); 20 | return salary.multiply(hraValue); 21 | } 22 | private BigDecimal da() { 23 | BigDecimal daValue = new BigDecimal("0.20"); 24 | return salary.multiply(daValue); 25 | } 26 | Employee(){ 27 | companyName= "Brain Mentors"; 28 | } 29 | public Employee(int id, String name, BigDecimal salary) { 30 | this(); 31 | this.id = id; 32 | this.name = StringUtil.titleCase(name); 33 | this.salary = salary; 34 | } 35 | public String getName() { 36 | return name; 37 | } 38 | public void setName(String name) { 39 | this.name = name; 40 | } 41 | public BigDecimal getSalary() { 42 | return salary; 43 | } 44 | public void setSalary(BigDecimal salary) { 45 | this.salary = salary; 46 | } 47 | public String getCompanyName() { 48 | return companyName; 49 | } 50 | public void setCompanyName(String companyName) { 51 | this.companyName = companyName; 52 | } 53 | public int getId() { 54 | return id; 55 | } 56 | 57 | 58 | } 59 | -------------------------------------------------------------------------------- /jquery/jszip-utils/dist/jszip-utils-ie.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | 3 | JSZipUtils - A collection of cross-browser utilities to go along with JSZip. 4 | 5 | 6 | (c) 2014 Stuart Knightley, David Duponchel 7 | Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip-utils/master/LICENSE.markdown. 8 | 9 | */ 10 | !function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g\r\n";document.write(b),a.JSZipUtils._getBinaryFromXHR=function(a){for(var b=a.responseBody,c={},d=0;256>d;d++)for(var e=0;256>e;e++)c[String.fromCharCode(d+(e<<8))]=String.fromCharCode(d)+String.fromCharCode(e);var f=IEBinaryToArray_ByteStr(b),g=IEBinaryToArray_ByteStr_Last(b);return f.replace(/[\s\S]/g,function(a){return c[a]})+g}},{}]},{},[1]); 11 | -------------------------------------------------------------------------------- /OverrideRule.java: -------------------------------------------------------------------------------- 1 | class X1{ 2 | int a, b; 3 | } 4 | class XPlus extends X1{ 5 | int c, d; 6 | } 7 | 8 | class Bill{ 9 | Person person = new Person(1001,"Ram"); 10 | Order order = new Order(); 11 | Payment pay =new Payment(); 12 | } 13 | class Person{ 14 | int id; 15 | String name; 16 | String address; 17 | String phone; 18 | String email; 19 | Person(int id , String name){ 20 | this.id = id; 21 | this.name = name; 22 | } 23 | } 24 | class Order{ 25 | int id =11; 26 | } 27 | class Payment{ 28 | String mode = "Card"; 29 | } 30 | 31 | class N{ 32 | 33 | X1 show() { 34 | System.out.println("N Show"); 35 | return new X1(); 36 | } 37 | } 38 | class M extends N{ 39 | @Override 40 | protected XPlus show() { 41 | System.out.println("M Show"); 42 | return new XPlus(); 43 | } 44 | // void takePersonData(int id, String name, String address,String phone, String gender, String currentAddress, String tempAddress){ 45 | // 46 | // } 47 | void takePersonData(Person person) { 48 | } 49 | Bill print() { 50 | // Person p = new Person(1001, "Amit"); 51 | // return p; 52 | //return new Person(1001,"Amit"); 53 | return new Bill(); 54 | //return 10; // 10 , Amit 55 | } 56 | // Person print() { 57 | //// Person p = new Person(1001, "Amit"); 58 | //// return p; 59 | // return new Person(1001,"Amit"); 60 | // //return 10; // 10 , Amit 61 | // } 62 | } 63 | public class OverrideRule { 64 | 65 | public static void main(String[] args) { 66 | // TODO Auto-generated method stub 67 | M m = new M(); 68 | Bill bill = m.print(); 69 | System.out.println(bill.person.id); 70 | System.out.println(bill.person.name); 71 | System.out.println(bill.order.id); 72 | System.out.println(bill.pay.mode); 73 | 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /DataTypes.java: -------------------------------------------------------------------------------- 1 | /*class BO{ 2 | void recData(User user){ 3 | 4 | } 5 | void recData(int id , char name[], char gender, 6 | char[] city, char []phone, course, duration , mail,){ 7 | 8 | } 9 | } 10 | class User{ 11 | id, name, gender, city, phone, 12 | }*/ 13 | import java.math.BigDecimal; 14 | import java.math.BigInteger; 15 | strictfp class DataTypes{ 16 | public static void main(String args[]){ 17 | 18 | int k1 = 1000; 19 | String.valueOf(k1); 20 | short s2 = (short) k1; 21 | double tt = k1; 22 | String a = "Ram"; 23 | Integer s = 1000; 24 | byte qq = s.byteValue(); // xxxValue() 25 | double w1 = s.doubleValue(); 26 | Strinng h1 = s.toString(); 27 | BigDecimal bb = new BigDecimal("1244548843.992"); 28 | String name = "Amit"; 29 | BigInteger bg = new BigInteger("1000000000"); 30 | BigInteger bg2 = new BigInteger("12000000000"); 31 | BigInteger bg3 = bg.add(bg2); 32 | System.out.println("Sum is "+bg3); 33 | 34 | boolean flag = true; //1 , 2 , 4 byte 35 | char w4 = 'A'; // 2 Byte 36 | long w11 = 10000L; // 8 Byte 37 | float w2 = 90.20F; // 4 Byte 38 | double w3 = 90.12; // 8 Byte 39 | 40 | short q = 100; //2 byte 41 | int w = 100000; // 4 byte 42 | byte x = 10; // 1 Byte 43 | x = (byte)130; 44 | System.out.println("X is "+x); 45 | byte a = 100; 46 | byte b = 100; 47 | b+=a; // Arithmetic Assignment Operator 48 | // += -= *= /= 49 | //b =(byte) (b + a); 50 | byte c = (byte)(a+b); 51 | //byte c = a + b; 52 | System.out.println("Sum is "+b); 53 | 54 | 55 | } 56 | } -------------------------------------------------------------------------------- /TestStudent.java: -------------------------------------------------------------------------------- 1 | import java.util.Scanner; 2 | 3 | public class TestStudent { 4 | 5 | public static void main(String[] args) { 6 | // TODO Auto-generated method stub 7 | //String r = new String("Hello"); 8 | Scanner scanner = new Scanner(System.in); 9 | System.out.println("Enter the Id "); 10 | int id = scanner.nextInt(); 11 | scanner.nextLine(); 12 | System.out.println("Enter the Name"); 13 | String name = scanner.nextLine(); 14 | System.out.println("Enter the Phone"); 15 | String phone = scanner.next(); 16 | //int marks[] = {90,88,67}; 17 | int marks [] = new int[3]; 18 | 19 | for(int i = 0 ; i{ 40 | a= a*b; 41 | return a+b; 42 | }; 43 | Calculate ca = (a,b)->a+b; 44 | System.out.println(ca.compute(10000, 20000)); 45 | 46 | MyCalc c = new MyCalc(); 47 | Calculate e= new Calculate() { 48 | 49 | @Override 50 | public int compute(int x, int y) { 51 | // TODO Auto-generated method stub 52 | return x-y; 53 | } 54 | }; 55 | System.out.println(e.compute(10, 20)); 56 | System.out.println(c.compute(100, 200)); 57 | if(10>2) { 58 | //Calculate d = new ________() 59 | Calculate d = new Calculate() { 60 | int x,y; 61 | void init() { 62 | x = 100; 63 | y = 200; 64 | } 65 | @Override 66 | public int compute(int x, int y) { 67 | // TODO Auto-generated method stub 68 | init(); 69 | return x * y; 70 | } 71 | }; 72 | 73 | System.out.println(d.compute(100, 2)); 74 | } 75 | 76 | 77 | // TODO Auto-generated method stub 78 | 79 | } 80 | 81 | } 82 | -------------------------------------------------------------------------------- /jquery/jquery-ui.structure.min.css: -------------------------------------------------------------------------------- 1 | /*! jQuery UI - v1.12.1 - 2018-12-06 2 | * http://jqueryui.com 3 | * Copyright jQuery Foundation and other contributors; Licensed MIT */ 4 | 5 | .ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important;pointer-events:none}.ui-icon{display:inline-block;vertical-align:middle;margin-top:-.25em;position:relative;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-icon-block{left:50%;margin-left:-8px;display:block}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-menu{list-style:none;padding:0;margin:0;display:block;outline:0}.ui-menu .ui-menu{position:absolute}.ui-menu .ui-menu-item{margin:0;cursor:pointer;list-style-image:url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7")}.ui-menu .ui-menu-item-wrapper{position:relative;padding:3px 1em 3px .4em}.ui-menu .ui-menu-divider{margin:5px 0;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-state-focus,.ui-menu .ui-state-active{margin:-1px}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item-wrapper{padding-left:2em}.ui-menu .ui-icon{position:absolute;top:0;bottom:0;left:.2em;margin:auto 0}.ui-menu .ui-menu-icon{left:auto;right:0} -------------------------------------------------------------------------------- /jquery/jszip-utils/dist/jszip-utils.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | 3 | JSZipUtils - A collection of cross-browser utilities to go along with JSZip. 4 | 5 | 6 | (c) 2014 Stuart Knightley, David Duponchel 7 | Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip-utils/master/LICENSE.markdown. 8 | 9 | */ 10 | !function(a){"object"==typeof exports?module.exports=a():"function"==typeof define&&define.amd?define(a):"undefined"!=typeof window?window.JSZipUtils=a():"undefined"!=typeof global?global.JSZipUtils=a():"undefined"!=typeof self&&(self.JSZipUtils=a())}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g=1; i--) { 65 | // System.out.println("I is "+i 66 | // +" Name "+Thread.currentThread().getName()); 67 | // } 68 | 69 | 70 | } 71 | 72 | } 73 | -------------------------------------------------------------------------------- /v3/src/com/brainmentors/billing/utils/CommonDAO.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.billing.utils; 2 | 3 | import java.sql.Connection; 4 | import java.sql.DriverManager; 5 | import java.sql.ResultSet; 6 | import java.sql.SQLException; 7 | import java.sql.Statement; 8 | 9 | public interface CommonDAO extends ConfigReader { 10 | 11 | public static Connection getConnection() throws ClassNotFoundException, SQLException { 12 | 13 | Connection con = null; 14 | /*String dbUserid = "root" ; 15 | String dbPassword = "amit123456"; 16 | String connectionString = "jdbc:mysql://localhost:3306/billingdb"; 17 | */ 18 | //Class.forName("com.mysql.cj.jdbc.Driver"); 19 | Class.forName(rb.getString(DRIVER)); 20 | System.out.println("Driver Loaded"); 21 | con = DriverManager.getConnection(rb.getString(DBURL) 22 | ,rb.getString(USERID),rb.getString(PWD)); 23 | return con; 24 | } 25 | /*public static void main(String[] args) throws ClassNotFoundException, SQLException { 26 | // String uid = "amit"; 27 | // String pwd = "78979"; 28 | // Connection con = null; 29 | // String dbUserid = "root"; 30 | // String dbPassword = "amit123456"; 31 | // String connectionString = "jdbc:mysql://localhost:3306/billingdb"; 32 | // Class.forName("com.mysql.cj.jdbc.Driver"); 33 | // System.out.println("Driver Loaded"); 34 | // con = DriverManager.getConnection(connectionString,dbUserid,dbPassword); 35 | Statement stmt = con.createStatement(); 36 | ResultSet rs = stmt.executeQuery("select userid from user_mst where userid='"+uid+"' and password='"+pwd+"'"); 37 | System.out.println("Userid is "+uid); 38 | if(rs.next()) { 39 | System.out.println("Welcome "+uid); 40 | } 41 | else { 42 | System.out.println("Invalid Userid or Password"); 43 | } 44 | rs.close(); 45 | stmt.close(); 46 | //con.close(); 47 | // if(con!=null) { 48 | // System.out.println("Connection Created...."); 49 | // //con.close(); 50 | // //con.close(); 51 | // } 52 | 53 | }*/ 54 | 55 | } 56 | -------------------------------------------------------------------------------- /v4/src/com/brainmentors/billing/utils/CommonDAO.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.billing.utils; 2 | 3 | import java.sql.Connection; 4 | import java.sql.DriverManager; 5 | import java.sql.ResultSet; 6 | import java.sql.SQLException; 7 | import java.sql.Statement; 8 | 9 | public interface CommonDAO extends ConfigReader { 10 | 11 | public static Connection getConnection() throws ClassNotFoundException, SQLException { 12 | 13 | Connection con = null; 14 | /*String dbUserid = "root" ; 15 | String dbPassword = "amit123456"; 16 | String connectionString = "jdbc:mysql://localhost:3306/billingdb"; 17 | */ 18 | //Class.forName("com.mysql.cj.jdbc.Driver"); 19 | Class.forName(rb.getString(DRIVER)); 20 | System.out.println("Driver Loaded"); 21 | con = DriverManager.getConnection(rb.getString(DBURL) 22 | ,rb.getString(USERID),rb.getString(PWD)); 23 | return con; 24 | } 25 | /*public static void main(String[] args) throws ClassNotFoundException, SQLException { 26 | // String uid = "amit"; 27 | // String pwd = "78979"; 28 | // Connection con = null; 29 | // String dbUserid = "root"; 30 | // String dbPassword = "amit123456"; 31 | // String connectionString = "jdbc:mysql://localhost:3306/billingdb"; 32 | // Class.forName("com.mysql.cj.jdbc.Driver"); 33 | // System.out.println("Driver Loaded"); 34 | // con = DriverManager.getConnection(connectionString,dbUserid,dbPassword); 35 | Statement stmt = con.createStatement(); 36 | ResultSet rs = stmt.executeQuery("select userid from user_mst where userid='"+uid+"' and password='"+pwd+"'"); 37 | System.out.println("Userid is "+uid); 38 | if(rs.next()) { 39 | System.out.println("Welcome "+uid); 40 | } 41 | else { 42 | System.out.println("Invalid Userid or Password"); 43 | } 44 | rs.close(); 45 | stmt.close(); 46 | //con.close(); 47 | // if(con!=null) { 48 | // System.out.println("Connection Created...."); 49 | // //con.close(); 50 | // //con.close(); 51 | // } 52 | 53 | }*/ 54 | 55 | } 56 | -------------------------------------------------------------------------------- /v5/src/com/brainmentors/billing/utils/CommonDAO.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.billing.utils; 2 | 3 | import java.sql.Connection; 4 | import java.sql.DriverManager; 5 | import java.sql.ResultSet; 6 | import java.sql.SQLException; 7 | import java.sql.Statement; 8 | 9 | public interface CommonDAO extends ConfigReader { 10 | 11 | public static Connection getConnection() throws ClassNotFoundException, SQLException { 12 | 13 | Connection con = null; 14 | /*String dbUserid = "root" ; 15 | String dbPassword = "amit123456"; 16 | String connectionString = "jdbc:mysql://localhost:3306/billingdb"; 17 | */ 18 | //Class.forName("com.mysql.cj.jdbc.Driver"); 19 | Class.forName(rb.getString(DRIVER)); 20 | System.out.println("Driver Loaded"); 21 | con = DriverManager.getConnection(rb.getString(DBURL) 22 | ,rb.getString(USERID),rb.getString(PWD)); 23 | return con; 24 | } 25 | /*public static void main(String[] args) throws ClassNotFoundException, SQLException { 26 | // String uid = "amit"; 27 | // String pwd = "78979"; 28 | // Connection con = null; 29 | // String dbUserid = "root"; 30 | // String dbPassword = "amit123456"; 31 | // String connectionString = "jdbc:mysql://localhost:3306/billingdb"; 32 | // Class.forName("com.mysql.cj.jdbc.Driver"); 33 | // System.out.println("Driver Loaded"); 34 | // con = DriverManager.getConnection(connectionString,dbUserid,dbPassword); 35 | Statement stmt = con.createStatement(); 36 | ResultSet rs = stmt.executeQuery("select userid from user_mst where userid='"+uid+"' and password='"+pwd+"'"); 37 | System.out.println("Userid is "+uid); 38 | if(rs.next()) { 39 | System.out.println("Welcome "+uid); 40 | } 41 | else { 42 | System.out.println("Invalid Userid or Password"); 43 | } 44 | rs.close(); 45 | stmt.close(); 46 | //con.close(); 47 | // if(con!=null) { 48 | // System.out.println("Connection Created...."); 49 | // //con.close(); 50 | // //con.close(); 51 | // } 52 | 53 | }*/ 54 | 55 | } 56 | -------------------------------------------------------------------------------- /ISADemo2.java: -------------------------------------------------------------------------------- 1 | class Shape{ 2 | void area() { 3 | System.out.println("Shape Area"); 4 | } 5 | void peri() { 6 | System.out.println("Shape Peri"); 7 | } 8 | } 9 | class Rect extends Shape{ 10 | @Override 11 | void area() { 12 | System.out.println("Rect Area"); 13 | } 14 | } 15 | class Circle extends Shape{ 16 | @Override 17 | void area() { 18 | System.out.println("Circle Area"); 19 | } 20 | void circum() { 21 | System.out.println("Circle Circum"); 22 | } 23 | } 24 | class Square extends Shape{ 25 | @Override 26 | void area() { 27 | System.out.println("Square Area"); 28 | } 29 | void allSideEquals() { 30 | System.out.println("All Side Equals Square"); 31 | } 32 | } 33 | 34 | class Drawing{ 35 | void draw(Shape shape) { 36 | shape.area(); 37 | shape.peri(); 38 | if(shape instanceof Square) { 39 | // int w = 100; 40 | // long rrrr = w; // implicit 41 | // long r = 1000; 42 | // int tt = (int)r; // explicit 43 | Square sq = (Square) shape; // Downcasting 44 | sq.allSideEquals(); 45 | } 46 | if(shape instanceof Circle) { 47 | ((Circle)shape).circum(); 48 | } 49 | System.out.println("**********************"); 50 | } 51 | } 52 | 53 | public class ISADemo2 { 54 | 55 | public static void main(String[] args) { 56 | Drawing drawing = new Drawing(); 57 | drawing.draw(new Square()); 58 | drawing.draw(new Circle()); 59 | drawing.draw(new Rect()); 60 | // Shape shape = new Square(); // Upcasting 61 | // shape.area(); 62 | // shape.peri(); 63 | // //shape.allSideEquals(); 64 | // shape = new Circle(); // Upcasting 65 | // shape.area(); 66 | // shape.peri(); 67 | //shape.circum(); 68 | /*Square square = new Square(); 69 | square.area(); 70 | square.peri(); 71 | square.allSideEquals(); 72 | System.out.println("***************"); 73 | Circle circle = new Circle(); 74 | circle.area(); 75 | circle.peri(); 76 | circle.circum(); 77 | System.out.println("******************"); 78 | Rect rect = new Rect(); 79 | rect.area(); 80 | rect.peri();*/ 81 | //square. 82 | // TODO Auto-generated method stub 83 | 84 | } 85 | 86 | } 87 | -------------------------------------------------------------------------------- /v3/src/com/brainmentors/billing/main/IntroScreen.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.billing.main; 2 | 3 | import java.awt.Color; 4 | 5 | import javax.swing.ImageIcon; 6 | import javax.swing.JFrame; 7 | import javax.swing.JLabel; 8 | import javax.swing.JPanel; 9 | import javax.swing.JProgressBar; 10 | import javax.swing.JWindow; 11 | import javax.swing.Timer; 12 | import javax.swing.border.EmptyBorder; 13 | 14 | import com.brainmentors.billing.user.Login; 15 | 16 | import jaco.mp3.player.MP3Player; 17 | 18 | public class IntroScreen extends JWindow { 19 | 20 | private void playSound() { 21 | 22 | MP3Player mp3 = new MP3Player(); 23 | mp3.play(); 24 | } 25 | private Timer timer; 26 | int counter = 1; 27 | JProgressBar progressBar = new JProgressBar(); 28 | private void doProgress() { 29 | 30 | timer = new Timer(5,(e)->{ 31 | if(counter>=100) { 32 | timer.stop(); 33 | this.setVisible(false); 34 | this.dispose(); 35 | Login login = new Login(); 36 | login.setVisible(true); 37 | } 38 | progressBar.setValue(counter); 39 | counter++; 40 | }) ; 41 | timer.start(); 42 | } 43 | 44 | private JPanel contentPane; 45 | 46 | /** 47 | * Launch the application. 48 | */ 49 | public static void main(String[] args) { 50 | 51 | IntroScreen frame = new IntroScreen(); 52 | frame.setVisible(true); 53 | frame.doProgress(); 54 | 55 | } 56 | 57 | /** 58 | * Create the frame. 59 | */ 60 | public IntroScreen() { 61 | //setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 62 | setBounds(100, 100, 600, 300); 63 | contentPane = new JPanel(); 64 | contentPane.setBackground(Color.WHITE); 65 | contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); 66 | setContentPane(contentPane); 67 | contentPane.setLayout(null); 68 | 69 | JLabel lblNewLabel = new JLabel(""); 70 | lblNewLabel.setIcon(new ImageIcon(IntroScreen.class.getResource("/com/brainmentors/billing/main/intro.jpg"))); 71 | lblNewLabel.setBounds(20, 6, 600, 226); 72 | contentPane.add(lblNewLabel); 73 | 74 | 75 | progressBar.setStringPainted(true); 76 | progressBar.setBounds(6, 235, 500, 40); 77 | contentPane.add(progressBar); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /v4/src/com/brainmentors/billing/main/IntroScreen.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.billing.main; 2 | 3 | import java.awt.Color; 4 | 5 | import javax.swing.ImageIcon; 6 | import javax.swing.JFrame; 7 | import javax.swing.JLabel; 8 | import javax.swing.JPanel; 9 | import javax.swing.JProgressBar; 10 | import javax.swing.JWindow; 11 | import javax.swing.Timer; 12 | import javax.swing.border.EmptyBorder; 13 | 14 | import com.brainmentors.billing.user.Login; 15 | 16 | import jaco.mp3.player.MP3Player; 17 | 18 | public class IntroScreen extends JWindow { 19 | 20 | private void playSound() { 21 | 22 | MP3Player mp3 = new MP3Player(); 23 | mp3.play(); 24 | } 25 | private Timer timer; 26 | int counter = 1; 27 | JProgressBar progressBar = new JProgressBar(); 28 | private void doProgress() { 29 | 30 | timer = new Timer(5,(e)->{ 31 | if(counter>=100) { 32 | timer.stop(); 33 | this.setVisible(false); 34 | this.dispose(); 35 | Login login = new Login(); 36 | login.setVisible(true); 37 | } 38 | progressBar.setValue(counter); 39 | counter++; 40 | }) ; 41 | timer.start(); 42 | } 43 | 44 | private JPanel contentPane; 45 | 46 | /** 47 | * Launch the application. 48 | */ 49 | public static void main(String[] args) { 50 | 51 | IntroScreen frame = new IntroScreen(); 52 | frame.setVisible(true); 53 | frame.doProgress(); 54 | 55 | } 56 | 57 | /** 58 | * Create the frame. 59 | */ 60 | public IntroScreen() { 61 | //setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 62 | setBounds(100, 100, 600, 300); 63 | contentPane = new JPanel(); 64 | contentPane.setBackground(Color.WHITE); 65 | contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); 66 | setContentPane(contentPane); 67 | contentPane.setLayout(null); 68 | 69 | JLabel lblNewLabel = new JLabel(""); 70 | lblNewLabel.setIcon(new ImageIcon(IntroScreen.class.getResource("/com/brainmentors/billing/main/intro.jpg"))); 71 | lblNewLabel.setBounds(20, 6, 600, 226); 72 | contentPane.add(lblNewLabel); 73 | 74 | 75 | progressBar.setStringPainted(true); 76 | progressBar.setBounds(6, 235, 500, 40); 77 | contentPane.add(progressBar); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /v2/src/com/brainmentors/billing/main/IntroScreen.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.billing.main; 2 | 3 | import java.awt.Color; 4 | 5 | import javax.swing.ImageIcon; 6 | import javax.swing.JFrame; 7 | import javax.swing.JLabel; 8 | import javax.swing.JPanel; 9 | import javax.swing.JProgressBar; 10 | import javax.swing.JWindow; 11 | import javax.swing.Timer; 12 | import javax.swing.border.EmptyBorder; 13 | 14 | import com.brainmentors.billing.user.Login; 15 | 16 | import jaco.mp3.player.MP3Player; 17 | 18 | public class IntroScreen extends JWindow { 19 | 20 | private void playSound() { 21 | 22 | MP3Player mp3 = new MP3Player(); 23 | mp3.play(); 24 | } 25 | private Timer timer; 26 | int counter = 1; 27 | JProgressBar progressBar = new JProgressBar(); 28 | private void doProgress() { 29 | 30 | timer = new Timer(100,(e)->{ 31 | if(counter>=100) { 32 | timer.stop(); 33 | this.setVisible(false); 34 | this.dispose(); 35 | Login login = new Login(); 36 | login.setVisible(true); 37 | } 38 | progressBar.setValue(counter); 39 | counter++; 40 | }) ; 41 | timer.start(); 42 | } 43 | 44 | private JPanel contentPane; 45 | 46 | /** 47 | * Launch the application. 48 | */ 49 | public static void main(String[] args) { 50 | 51 | IntroScreen frame = new IntroScreen(); 52 | frame.setVisible(true); 53 | frame.doProgress(); 54 | 55 | } 56 | 57 | /** 58 | * Create the frame. 59 | */ 60 | public IntroScreen() { 61 | //setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 62 | setBounds(100, 100, 600, 300); 63 | contentPane = new JPanel(); 64 | contentPane.setBackground(Color.WHITE); 65 | contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); 66 | setContentPane(contentPane); 67 | contentPane.setLayout(null); 68 | 69 | JLabel lblNewLabel = new JLabel(""); 70 | lblNewLabel.setIcon(new ImageIcon(IntroScreen.class.getResource("/com/brainmentors/billing/main/intro.jpg"))); 71 | lblNewLabel.setBounds(20, 6, 600, 226); 72 | contentPane.add(lblNewLabel); 73 | 74 | 75 | progressBar.setStringPainted(true); 76 | progressBar.setBounds(6, 235, 500, 40); 77 | contentPane.add(progressBar); 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /v5/src/com/brainmentors/billing/main/ViewCart.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.billing.main; 2 | 3 | import java.awt.Color; 4 | import java.awt.Font; 5 | import java.awt.event.ActionEvent; 6 | import java.awt.event.ActionListener; 7 | import java.awt.print.PrinterException; 8 | import java.util.ArrayList; 9 | 10 | import javax.swing.JButton; 11 | import javax.swing.JFrame; 12 | import javax.swing.JLabel; 13 | import javax.swing.JPanel; 14 | import javax.swing.JScrollPane; 15 | import javax.swing.JTable; 16 | import javax.swing.SwingConstants; 17 | import javax.swing.border.EmptyBorder; 18 | 19 | import com.brainmentors.billing.model.Product; 20 | import com.brainmentors.billing.model.ProductTableModel; 21 | import com.brainmentors.billing.utils.MailSender; 22 | 23 | public class ViewCart extends JFrame { 24 | 25 | private JPanel contentPane; 26 | private JTable table; 27 | 28 | private void printIt() { 29 | try { 30 | table.print(); 31 | MailSender.sendMail(); 32 | } catch (PrinterException e) { 33 | // TODO Auto-generated catch block 34 | e.printStackTrace(); 35 | } 36 | } 37 | public ViewCart(ArrayList list) { 38 | setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 39 | setBounds(100, 100, 450, 300); 40 | contentPane = new JPanel(); 41 | contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); 42 | setContentPane(contentPane); 43 | contentPane.setLayout(null); 44 | 45 | JLabel lblItemsInCart = new JLabel("Items in Cart"); 46 | lblItemsInCart.setForeground(Color.RED); 47 | lblItemsInCart.setHorizontalAlignment(SwingConstants.CENTER); 48 | lblItemsInCart.setFont(new Font("Lucida Grande", Font.BOLD, 20)); 49 | lblItemsInCart.setBounds(96, 31, 218, 16); 50 | contentPane.add(lblItemsInCart); 51 | 52 | JScrollPane scrollPane = new JScrollPane(); 53 | scrollPane.setBounds(21, 82, 335, 190); 54 | contentPane.add(scrollPane); 55 | ProductTableModel model = new ProductTableModel(list); 56 | table = new JTable(model); 57 | scrollPane.setViewportView(table); 58 | 59 | JButton btnPrint = new JButton("Print"); 60 | btnPrint.addActionListener(new ActionListener() { 61 | public void actionPerformed(ActionEvent e) { 62 | printIt(); 63 | } 64 | }); 65 | btnPrint.setBounds(6, 29, 117, 29); 66 | contentPane.add(btnPrint); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /v3/src/com/brainmentors/billing/main/DashBoard.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.billing.main; 2 | 3 | import java.awt.Color; 4 | import java.awt.Font; 5 | import java.awt.event.ActionEvent; 6 | import java.awt.event.ActionListener; 7 | import java.io.File; 8 | import java.io.IOException; 9 | 10 | import javax.swing.JFileChooser; 11 | import javax.swing.JFrame; 12 | import javax.swing.JLabel; 13 | import javax.swing.JMenu; 14 | import javax.swing.JMenuBar; 15 | import javax.swing.JMenuItem; 16 | import javax.swing.JPanel; 17 | import javax.swing.border.EmptyBorder; 18 | 19 | import com.brainmentors.billing.utils.ConfigReader; 20 | import com.brainmentors.billing.utils.ExcelReader; 21 | 22 | public class DashBoard extends JFrame { 23 | 24 | private JPanel contentPane; 25 | 26 | private void doUpload() { 27 | JFileChooser browse = 28 | new JFileChooser(ConfigReader.getValue(ConfigReader.BROWSE_PATH)); 29 | browse.showOpenDialog(this); 30 | File file = browse.getSelectedFile(); 31 | try { 32 | ExcelReader.readXLS(file); 33 | } catch (IOException e) { 34 | // TODO Auto-generated catch block 35 | e.printStackTrace(); 36 | } 37 | System.out.println(file.getPath()); 38 | } 39 | 40 | private void createMenu() { 41 | JMenuBar menuBar = new JMenuBar(); 42 | this.setJMenuBar(menuBar); 43 | JMenu admin =new JMenu("Admin"); 44 | menuBar.add(admin); 45 | JMenuItem upload = new JMenuItem("Upload"); 46 | upload.addActionListener(new ActionListener() { 47 | public void actionPerformed(ActionEvent e) { 48 | doUpload(); 49 | } 50 | }); 51 | admin.add(upload); 52 | admin.addSeparator(); 53 | JMenuItem exit = new JMenuItem("Exit"); 54 | admin.add(exit); 55 | 56 | 57 | } 58 | 59 | 60 | 61 | /** 62 | * Create the frame. 63 | */ 64 | public DashBoard(String userid) { 65 | setTitle("DASHBOARD"); 66 | setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 67 | setBounds(100, 100, 450, 300); 68 | contentPane = new JPanel(); 69 | contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); 70 | setContentPane(contentPane); 71 | contentPane.setLayout(null); 72 | 73 | JLabel welcomelbl = new JLabel("Welcome "+userid); 74 | welcomelbl.setForeground(Color.RED); 75 | welcomelbl.setFont(new Font("Lucida Grande", Font.BOLD, 18)); 76 | welcomelbl.setBounds(22, 6, 264, 39); 77 | contentPane.add(welcomelbl); 78 | createMenu(); 79 | } 80 | 81 | } 82 | -------------------------------------------------------------------------------- /v5/src/com/brainmentors/billing/main/IntroScreen.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.billing.main; 2 | 3 | import java.awt.Color; 4 | 5 | import javax.swing.ImageIcon; 6 | import javax.swing.JFrame; 7 | import javax.swing.JLabel; 8 | import javax.swing.JPanel; 9 | import javax.swing.JProgressBar; 10 | import javax.swing.JWindow; 11 | import javax.swing.Timer; 12 | import javax.swing.border.EmptyBorder; 13 | 14 | import org.apache.log4j.Logger; 15 | 16 | import com.brainmentors.billing.user.Login; 17 | 18 | import jaco.mp3.player.MP3Player; 19 | 20 | public class IntroScreen extends JWindow { 21 | Logger logger = Logger.getLogger(IntroScreen.class); 22 | private void playSound() { 23 | 24 | MP3Player mp3 = new MP3Player(); 25 | mp3.play(); 26 | } 27 | private Timer timer; 28 | int counter = 1; 29 | JProgressBar progressBar = new JProgressBar(); 30 | private void doProgress() { 31 | 32 | timer = new Timer(5,(e)->{ 33 | if(counter>=100) { 34 | timer.stop(); 35 | this.setVisible(false); 36 | this.dispose(); 37 | Login login = new Login(); 38 | login.setVisible(true); 39 | } 40 | progressBar.setValue(counter); 41 | counter++; 42 | }) ; 43 | timer.start(); 44 | } 45 | 46 | private JPanel contentPane; 47 | 48 | /** 49 | * Launch the application. 50 | */ 51 | public static void main(String[] args) { 52 | 53 | IntroScreen frame = new IntroScreen(); 54 | frame.logger.debug("Main Start"); 55 | frame.setVisible(true); 56 | frame.doProgress(); 57 | frame.logger.debug("Main Ends"); 58 | 59 | } 60 | 61 | /** 62 | * Create the frame. 63 | */ 64 | public IntroScreen() { 65 | logger.debug("INside IntroScreen Constructor Start"); 66 | //setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 67 | setBounds(100, 100, 600, 300); 68 | contentPane = new JPanel(); 69 | contentPane.setBackground(Color.WHITE); 70 | contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); 71 | setContentPane(contentPane); 72 | contentPane.setLayout(null); 73 | 74 | JLabel lblNewLabel = new JLabel(""); 75 | lblNewLabel.setIcon(new ImageIcon(IntroScreen.class.getResource("/com/brainmentors/billing/main/intro.jpg"))); 76 | lblNewLabel.setBounds(20, 6, 600, 226); 77 | contentPane.add(lblNewLabel); 78 | 79 | 80 | progressBar.setStringPainted(true); 81 | progressBar.setBounds(6, 235, 500, 40); 82 | contentPane.add(progressBar); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /v4/src/com/brainmentors/billing/utils/ExcelReader.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.billing.utils; 2 | 3 | import java.io.File; 4 | import java.io.FileInputStream; 5 | import java.io.IOException; 6 | import java.util.ArrayList; 7 | import java.util.Iterator; 8 | 9 | import org.apache.poi.hssf.usermodel.HSSFSheet; 10 | import org.apache.poi.hssf.usermodel.HSSFWorkbook; 11 | import org.apache.poi.ss.usermodel.Cell; 12 | import org.apache.poi.ss.usermodel.CellType; 13 | import org.apache.poi.ss.usermodel.Row; 14 | 15 | import com.brainmentors.billing.model.Product; 16 | 17 | 18 | public interface ExcelReader { 19 | 20 | public static ArrayList readXLS(File file) throws IOException { 21 | boolean isFirstPass = true; 22 | ArrayList productList = new ArrayList<>(); 23 | if(!file.exists()) { 24 | return null; 25 | } 26 | FileInputStream fs = new FileInputStream(file); 27 | HSSFWorkbook workBook = new HSSFWorkbook(fs); 28 | HSSFSheet sheet = workBook.getSheetAt(9); 29 | Iterator rows = sheet.rowIterator(); 30 | 31 | while(rows.hasNext()) { 32 | int cellCounter = 1; 33 | Row currentRow = rows.next(); 34 | if(isFirstPass) { 35 | isFirstPass = false; 36 | continue; 37 | } 38 | Iterator cells = currentRow.cellIterator(); 39 | Product product = new Product(); 40 | while(cells.hasNext()) { 41 | Cell currentCell = cells.next(); 42 | switch(cellCounter) { 43 | case 1: 44 | product.setId((int)currentCell.getNumericCellValue()); 45 | break; 46 | case 2: 47 | product.setName(currentCell.getStringCellValue()); 48 | break; 49 | case 3: 50 | product.setDesc(currentCell.getStringCellValue()); 51 | break; 52 | case 4: 53 | product.setPrice(currentCell.getNumericCellValue()); 54 | break; 55 | case 5: 56 | product.setPath(currentCell.getStringCellValue()); 57 | break; 58 | case 6: 59 | product.setQuantity((int)currentCell.getNumericCellValue()); 60 | break; 61 | } 62 | cellCounter++; 63 | 64 | // if(currentCell.getCellType()==CellType.STRING) { 65 | // System.out.println(currentCell.getStringCellValue()); 66 | // } 67 | // else 68 | // if(currentCell.getCellType()==CellType.NUMERIC) { 69 | // System.out.println(currentCell.getNumericCellValue()); 70 | // } 71 | } // Cell Loop Ends 72 | productList.add(product); 73 | } // Row Loop Ends 74 | workBook.close(); 75 | fs.close(); 76 | return productList; 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /v5/src/com/brainmentors/billing/utils/ExcelReader.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.billing.utils; 2 | 3 | import java.io.File; 4 | import java.io.FileInputStream; 5 | import java.io.IOException; 6 | import java.util.ArrayList; 7 | import java.util.Iterator; 8 | 9 | import org.apache.poi.hssf.usermodel.HSSFSheet; 10 | import org.apache.poi.hssf.usermodel.HSSFWorkbook; 11 | import org.apache.poi.ss.usermodel.Cell; 12 | import org.apache.poi.ss.usermodel.CellType; 13 | import org.apache.poi.ss.usermodel.Row; 14 | 15 | import com.brainmentors.billing.model.Product; 16 | 17 | 18 | public interface ExcelReader { 19 | 20 | public static ArrayList readXLS(File file) throws IOException { 21 | boolean isFirstPass = true; 22 | ArrayList productList = new ArrayList<>(); 23 | if(!file.exists()) { 24 | return null; 25 | } 26 | FileInputStream fs = new FileInputStream(file); 27 | HSSFWorkbook workBook = new HSSFWorkbook(fs); 28 | HSSFSheet sheet = workBook.getSheetAt(9); 29 | Iterator rows = sheet.rowIterator(); 30 | 31 | while(rows.hasNext()) { 32 | int cellCounter = 1; 33 | Row currentRow = rows.next(); 34 | if(isFirstPass) { 35 | isFirstPass = false; 36 | continue; 37 | } 38 | Iterator cells = currentRow.cellIterator(); 39 | Product product = new Product(); 40 | while(cells.hasNext()) { 41 | Cell currentCell = cells.next(); 42 | switch(cellCounter) { 43 | case 1: 44 | product.setId((int)currentCell.getNumericCellValue()); 45 | break; 46 | case 2: 47 | product.setName(currentCell.getStringCellValue()); 48 | break; 49 | case 3: 50 | product.setDesc(currentCell.getStringCellValue()); 51 | break; 52 | case 4: 53 | product.setPrice(currentCell.getNumericCellValue()); 54 | break; 55 | case 5: 56 | product.setPath(currentCell.getStringCellValue()); 57 | break; 58 | case 6: 59 | product.setQuantity((int)currentCell.getNumericCellValue()); 60 | break; 61 | } 62 | cellCounter++; 63 | 64 | // if(currentCell.getCellType()==CellType.STRING) { 65 | // System.out.println(currentCell.getStringCellValue()); 66 | // } 67 | // else 68 | // if(currentCell.getCellType()==CellType.NUMERIC) { 69 | // System.out.println(currentCell.getNumericCellValue()); 70 | // } 71 | } // Cell Loop Ends 72 | productList.add(product); 73 | } // Row Loop Ends 74 | workBook.close(); 75 | fs.close(); 76 | return productList; 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /exceptiondemo/Demo.java: -------------------------------------------------------------------------------- 1 | package exceptiondemo; 2 | 3 | import java.util.InputMismatchException; 4 | import java.util.Scanner; 5 | 6 | public class Demo { 7 | static int firstNumber = 0; 8 | static int secondNumber = 0; 9 | static int result = 0; 10 | static Scanner scanner = new Scanner(System.in); 11 | static void takeFirstNumber() { 12 | try { 13 | 14 | System.out.println("Enter the First Number"); 15 | firstNumber = scanner.nextInt(); // throw new InputMismatchException() 16 | } 17 | catch(InputMismatchException ex) { 18 | scanner.nextLine(); 19 | System.out.println("Only Number Allowed U enter something else"); 20 | takeFirstNumber(); 21 | } 22 | } 23 | static void takeSecondNumber() { 24 | try { 25 | 26 | System.out.println("Enter the Second Number"); 27 | secondNumber = scanner.nextInt(); // throw new InputMismatchException() 28 | } 29 | catch(InputMismatchException ex) { 30 | scanner.nextLine(); 31 | System.out.println("Only Number Allowed U enter something else"); 32 | takeSecondNumber(); 33 | } 34 | } 35 | static void divide() { 36 | try { 37 | result = firstNumber / secondNumber; 38 | 39 | } 40 | catch(ArithmeticException ex) { 41 | System.out.println("U Divide a number with Zero "); 42 | takeSecondNumber(); 43 | divide(); 44 | } 45 | } 46 | static void print() { 47 | System.out.println("Result is "+result); 48 | scanner.close(); 49 | } 50 | 51 | public static void main(String[] args) { 52 | takeFirstNumber(); 53 | takeSecondNumber(); 54 | divide(); 55 | print(); 56 | // int firstNumber = 0; 57 | // int secondNumber = 0; 58 | // int result = 0; 59 | // try { 60 | // 61 | // System.out.println("Enter the First Number"); 62 | // firstNumber = scanner.nextInt(); // throw new InputMismatchException() 63 | // } 64 | // catch(InputMismatchException ex) { 65 | // scanner.nextLine(); 66 | // System.out.println("Only Number Allowed U enter something else"); 67 | // } 68 | // try { 69 | // System.out.println("Enter the Second Number"); 70 | // secondNumber = scanner.nextInt(); 71 | // } 72 | // catch(InputMismatchException ex) { 73 | // System.out.println("Only Number Allowed U enter something else"); 74 | // } 75 | // try { 76 | // result = firstNumber / secondNumber; 77 | // } 78 | // catch(ArithmeticException ex) { 79 | // System.out.println("U Divide a number with Zero "); 80 | // } 81 | // System.out.println("Result is "+result); 82 | // scanner.close(); 83 | 84 | } 85 | 86 | } 87 | -------------------------------------------------------------------------------- /SwitchCaseDemo.java: -------------------------------------------------------------------------------- 1 | class SwitchCaseDemo{ 2 | public static void main(String[] args) { 3 | outer: 4 | for(int i = 1; i<=3; i++){ 5 | for(int j = 1; j<=3; j++){ 6 | if(i==j){ 7 | //break; 8 | continue outer; 9 | } 10 | System.out.println("I is "+i+" and J is "+j); 11 | } 12 | } 13 | System.out.println("############################"); 14 | int a[] = {10,20,30,40,50}; 15 | for(int x : a){ 16 | System.out.println(x); 17 | } 18 | System.out.println("*****************************"); 19 | // for(int i = 0 ; i 5 | 6 | (c) 2014 Stuart Knightley, David Duponchel 7 | Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip-utils/master/LICENSE.markdown. 8 | 9 | */ 10 | ;(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o\r\n"+ 18 | "\r\n"; 32 | 33 | // inject VBScript 34 | document.write(IEBinaryToArray_ByteStr_Script); 35 | 36 | global.JSZipUtils._getBinaryFromXHR = function (xhr) { 37 | var binary = xhr.responseBody; 38 | var byteMapping = {}; 39 | for ( var i = 0; i < 256; i++ ) { 40 | for ( var j = 0; j < 256; j++ ) { 41 | byteMapping[ String.fromCharCode( i + (j << 8) ) ] = 42 | String.fromCharCode(i) + String.fromCharCode(j); 43 | } 44 | } 45 | var rawBytes = IEBinaryToArray_ByteStr(binary); 46 | var lastChr = IEBinaryToArray_ByteStr_Last(binary); 47 | return rawBytes.replace(/[\s\S]/g, function( match ) { 48 | return byteMapping[match]; 49 | }) + lastChr; 50 | }; 51 | 52 | // enforcing Stuk's coding style 53 | // vim: set shiftwidth=4 softtabstop=4: 54 | 55 | },{}]},{},[1]) 56 | ; 57 | -------------------------------------------------------------------------------- /v2/src/com/brainmentors/billing/user/UserDAO.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.billing.user; 2 | 3 | import java.sql.Connection; 4 | import java.sql.ResultSet; 5 | import java.sql.SQLException; 6 | import java.sql.Statement; 7 | 8 | import com.brainmentors.billing.utils.CommonDAO; 9 | 10 | public class UserDAO { 11 | public boolean register(String uid, String pwd) throws ClassNotFoundException, SQLException { 12 | //String uid = "amit"; 13 | //String pwd = "78979"; 14 | ResultSet rs = null; 15 | Connection con = null; 16 | Statement stmt = null; 17 | try { 18 | con = CommonDAO.getConnection(); 19 | 20 | stmt = con.createStatement(); 21 | int recordCount = stmt.executeUpdate("insert into user_mst (userid,password) values('"+uid+"','"+pwd+"')" ); 22 | 23 | if(recordCount>0) { 24 | return true; 25 | //System.out.println("Welcome "+uid); 26 | } 27 | else { 28 | return false; 29 | //System.out.println("Invalid Userid or Password"); 30 | } 31 | } 32 | finally { 33 | 34 | stmt.close(); 35 | //con.close(); 36 | } 37 | 38 | } 39 | public boolean isUserExist(String uid) throws ClassNotFoundException, SQLException { 40 | //String uid = "amit"; 41 | //String pwd = "78979"; 42 | ResultSet rs = null; 43 | Connection con = null; 44 | Statement stmt = null; 45 | try { 46 | con = CommonDAO.getConnection(); 47 | 48 | stmt = con.createStatement(); 49 | rs = stmt.executeQuery("select userid " 50 | + "from user_mst where " 51 | + "userid='"+uid+"'"); 52 | System.out.println("Userid is "+uid); 53 | if(rs.next()) { 54 | return true; 55 | //System.out.println("Welcome "+uid); 56 | } 57 | else { 58 | return false; 59 | //System.out.println("Invalid Userid or Password"); 60 | } 61 | } 62 | finally { 63 | rs.close(); 64 | stmt.close(); 65 | //con.close(); 66 | } 67 | 68 | } 69 | public boolean loginCheck(String uid, String pwd) throws ClassNotFoundException, SQLException { 70 | //String uid = "amit"; 71 | //String pwd = "78979"; 72 | ResultSet rs = null; 73 | Connection con = null; 74 | Statement stmt = null; 75 | try { 76 | con = CommonDAO.getConnection(); 77 | 78 | stmt = con.createStatement(); 79 | rs = stmt.executeQuery("select userid " 80 | + "from user_mst where " 81 | + "userid='"+uid+"' and " 82 | + "password='"+pwd+"'"); 83 | System.out.println("Userid is "+uid); 84 | if(rs.next()) { 85 | return true; 86 | //System.out.println("Welcome "+uid); 87 | } 88 | else { 89 | return false; 90 | //System.out.println("Invalid Userid or Password"); 91 | } 92 | } 93 | finally { 94 | rs.close(); 95 | stmt.close(); 96 | //con.close(); 97 | } 98 | 99 | } 100 | 101 | } 102 | -------------------------------------------------------------------------------- /v3/src/com/brainmentors/billing/user/UserDAO.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.billing.user; 2 | 3 | import java.sql.Connection; 4 | import java.sql.ResultSet; 5 | import java.sql.SQLException; 6 | import java.sql.Statement; 7 | 8 | import com.brainmentors.billing.utils.CommonDAO; 9 | 10 | public class UserDAO { 11 | public boolean register(String uid, String pwd) throws ClassNotFoundException, SQLException { 12 | //String uid = "amit"; 13 | //String pwd = "78979"; 14 | ResultSet rs = null; 15 | Connection con = null; 16 | Statement stmt = null; 17 | try { 18 | con = CommonDAO.getConnection(); 19 | 20 | stmt = con.createStatement(); 21 | int recordCount = stmt.executeUpdate("insert into user_mst (userid,password) values('"+uid+"','"+pwd+"')" ); 22 | 23 | if(recordCount>0) { 24 | return true; 25 | //System.out.println("Welcome "+uid); 26 | } 27 | else { 28 | return false; 29 | //System.out.println("Invalid Userid or Password"); 30 | } 31 | } 32 | finally { 33 | 34 | stmt.close(); 35 | //con.close(); 36 | } 37 | 38 | } 39 | public boolean isUserExist(String uid) throws ClassNotFoundException, SQLException { 40 | //String uid = "amit"; 41 | //String pwd = "78979"; 42 | ResultSet rs = null; 43 | Connection con = null; 44 | Statement stmt = null; 45 | try { 46 | con = CommonDAO.getConnection(); 47 | 48 | stmt = con.createStatement(); 49 | rs = stmt.executeQuery("select userid " 50 | + "from user_mst where " 51 | + "userid='"+uid+"'"); 52 | System.out.println("Userid is "+uid); 53 | if(rs.next()) { 54 | return true; 55 | //System.out.println("Welcome "+uid); 56 | } 57 | else { 58 | return false; 59 | //System.out.println("Invalid Userid or Password"); 60 | } 61 | } 62 | finally { 63 | rs.close(); 64 | stmt.close(); 65 | //con.close(); 66 | } 67 | 68 | } 69 | public boolean loginCheck(String uid, String pwd) throws ClassNotFoundException, SQLException { 70 | //String uid = "amit"; 71 | //String pwd = "78979"; 72 | ResultSet rs = null; 73 | Connection con = null; 74 | Statement stmt = null; 75 | try { 76 | con = CommonDAO.getConnection(); 77 | 78 | stmt = con.createStatement(); 79 | rs = stmt.executeQuery("select userid " 80 | + "from user_mst where " 81 | + "userid='"+uid+"' and " 82 | + "password='"+pwd+"'"); 83 | System.out.println("Userid is "+uid); 84 | if(rs.next()) { 85 | return true; 86 | //System.out.println("Welcome "+uid); 87 | } 88 | else { 89 | return false; 90 | //System.out.println("Invalid Userid or Password"); 91 | } 92 | } 93 | finally { 94 | rs.close(); 95 | stmt.close(); 96 | //con.close(); 97 | } 98 | 99 | } 100 | 101 | } 102 | -------------------------------------------------------------------------------- /v4/src/com/brainmentors/billing/user/UserDAO.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.billing.user; 2 | 3 | import java.sql.Connection; 4 | import java.sql.ResultSet; 5 | import java.sql.SQLException; 6 | import java.sql.Statement; 7 | 8 | import com.brainmentors.billing.utils.CommonDAO; 9 | 10 | public class UserDAO { 11 | public boolean register(String uid, String pwd) throws ClassNotFoundException, SQLException { 12 | //String uid = "amit"; 13 | //String pwd = "78979"; 14 | ResultSet rs = null; 15 | Connection con = null; 16 | Statement stmt = null; 17 | try { 18 | con = CommonDAO.getConnection(); 19 | 20 | stmt = con.createStatement(); 21 | int recordCount = stmt.executeUpdate("insert into user_mst (userid,password) values('"+uid+"','"+pwd+"')" ); 22 | 23 | if(recordCount>0) { 24 | return true; 25 | //System.out.println("Welcome "+uid); 26 | } 27 | else { 28 | return false; 29 | //System.out.println("Invalid Userid or Password"); 30 | } 31 | } 32 | finally { 33 | 34 | stmt.close(); 35 | //con.close(); 36 | } 37 | 38 | } 39 | public boolean isUserExist(String uid) throws ClassNotFoundException, SQLException { 40 | //String uid = "amit"; 41 | //String pwd = "78979"; 42 | ResultSet rs = null; 43 | Connection con = null; 44 | Statement stmt = null; 45 | try { 46 | con = CommonDAO.getConnection(); 47 | 48 | stmt = con.createStatement(); 49 | rs = stmt.executeQuery("select userid " 50 | + "from user_mst where " 51 | + "userid='"+uid+"'"); 52 | System.out.println("Userid is "+uid); 53 | if(rs.next()) { 54 | return true; 55 | //System.out.println("Welcome "+uid); 56 | } 57 | else { 58 | return false; 59 | //System.out.println("Invalid Userid or Password"); 60 | } 61 | } 62 | finally { 63 | rs.close(); 64 | stmt.close(); 65 | //con.close(); 66 | } 67 | 68 | } 69 | public boolean loginCheck(String uid, String pwd) throws ClassNotFoundException, SQLException { 70 | //String uid = "amit"; 71 | //String pwd = "78979"; 72 | ResultSet rs = null; 73 | Connection con = null; 74 | Statement stmt = null; 75 | try { 76 | con = CommonDAO.getConnection(); 77 | 78 | stmt = con.createStatement(); 79 | rs = stmt.executeQuery("select userid " 80 | + "from user_mst where " 81 | + "userid='"+uid+"' and " 82 | + "password='"+pwd+"'"); 83 | System.out.println("Userid is "+uid); 84 | if(rs.next()) { 85 | return true; 86 | //System.out.println("Welcome "+uid); 87 | } 88 | else { 89 | return false; 90 | //System.out.println("Invalid Userid or Password"); 91 | } 92 | } 93 | finally { 94 | rs.close(); 95 | stmt.close(); 96 | //con.close(); 97 | } 98 | 99 | } 100 | 101 | } 102 | -------------------------------------------------------------------------------- /v5/src/com/brainmentors/billing/user/UserDAO.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.billing.user; 2 | 3 | import java.sql.Connection; 4 | import java.sql.PreparedStatement; 5 | import java.sql.ResultSet; 6 | import java.sql.SQLException; 7 | import java.sql.Statement; 8 | 9 | import com.brainmentors.billing.utils.CommonDAO; 10 | 11 | public class UserDAO { 12 | public boolean register(String uid, String pwd) throws ClassNotFoundException, SQLException { 13 | //String uid = "amit"; 14 | //String pwd = "78979"; 15 | ResultSet rs = null; 16 | Connection con = null; 17 | Statement stmt = null; 18 | try { 19 | con = CommonDAO.getConnection(); 20 | 21 | stmt = con.createStatement(); 22 | int recordCount = stmt.executeUpdate("insert into user_mst (userid,password) values('"+uid+"',"+pwd+")" ); 23 | 24 | if(recordCount>0) { 25 | return true; 26 | //System.out.println("Welcome "+uid); 27 | } 28 | else { 29 | return false; 30 | //System.out.println("Invalid Userid or Password"); 31 | } 32 | } 33 | finally { 34 | 35 | stmt.close(); 36 | //con.close(); 37 | } 38 | 39 | } 40 | public boolean isUserExist(String uid) throws ClassNotFoundException, SQLException { 41 | //String uid = "amit"; 42 | //String pwd = "78979"; 43 | ResultSet rs = null; 44 | Connection con = null; 45 | Statement stmt = null; 46 | try { 47 | con = CommonDAO.getConnection(); 48 | 49 | stmt = con.createStatement(); 50 | rs = stmt.executeQuery("select userid " 51 | + "from user_mst where " 52 | + "userid='"+uid+"'"); 53 | System.out.println("Userid is "+uid); 54 | if(rs.next()) { 55 | return true; 56 | //System.out.println("Welcome "+uid); 57 | } 58 | else { 59 | return false; 60 | //System.out.println("Invalid Userid or Password"); 61 | } 62 | } 63 | finally { 64 | rs.close(); 65 | stmt.close(); 66 | //con.close(); 67 | } 68 | 69 | } 70 | public boolean loginCheck(String uid, String pwd) throws ClassNotFoundException, SQLException { 71 | //String uid = "amit"; 72 | //String pwd = "78979"; 73 | ResultSet rs = null; 74 | Connection con = null; 75 | //Statement stmt = null; 76 | PreparedStatement stmt = null; 77 | try { 78 | con = CommonDAO.getConnection(); 79 | 80 | //stmt = con.createStatement(); 81 | stmt = con.prepareStatement("select userid " 82 | + "from user_mst where userid=? and password=?"); 83 | 84 | // rs = stmt.executeQuery("select userid " 85 | // + "from user_mst where " 86 | // + "userid='"+uid+"' and " 87 | // + "password="+pwd); 88 | stmt.setString(1, uid); 89 | stmt.setString(2, pwd); 90 | rs = stmt.executeQuery(); 91 | //stmt.setInt(2, Integer.parseInt(pwd)); 92 | System.out.println("Userid is "+uid); 93 | if(rs.next()) { 94 | return true; 95 | //System.out.println("Welcome "+uid); 96 | } 97 | else { 98 | return false; 99 | //System.out.println("Invalid Userid or Password"); 100 | } 101 | } 102 | finally { 103 | //rs.close(); 104 | //stmt.close(); 105 | //con.close(); 106 | } 107 | 108 | } 109 | 110 | } 111 | -------------------------------------------------------------------------------- /gaming/src/com/brainmentors/gaming/Player.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.gaming; 2 | 3 | import java.awt.Graphics; 4 | import java.awt.image.BufferedImage; 5 | import java.util.ArrayList; 6 | 7 | public class Player extends Sprite implements GameConstants,IPlayer { 8 | private ArrayList bullets = new ArrayList<>(); 9 | private int force; 10 | private boolean isJumped; 11 | private BufferedImage def[] ; 12 | private BufferedImage punch[] ; 13 | private int state; 14 | public Player() { 15 | state = MOVE; 16 | isJumped = false; 17 | speed = 5; 18 | x = 100; 19 | h = w = 100; 20 | y = FLOOR - h; 21 | image= ImageLoader.loadImage(PLAYER_IMG); 22 | def = loadDefaultMove(); 23 | punch = loadPunch(); 24 | 25 | } 26 | 27 | 28 | public int getState() { 29 | return state; 30 | } 31 | 32 | 33 | public void setState(int state) { 34 | this.state = state; 35 | } 36 | 37 | 38 | private BufferedImage[] loadDefaultMove() { 39 | BufferedImage def[] = new BufferedImage[4]; 40 | 41 | def[0] = image.getSubimage(15, 565, 46, 75); 42 | def[1] = image.getSubimage(83, 510, 36, 110); 43 | def[2]= image.getSubimage(152, 527, 32, 103); 44 | 45 | def[3]= image.getSubimage(230, 545, 36, 98); 46 | return def; 47 | } 48 | 49 | public BufferedImage[] loadPunch() { 50 | 51 | BufferedImage punch[] = new BufferedImage[3]; 52 | punch[0] = image.getSubimage(383, 20, 60, 82); 53 | punch[1] = image.getSubimage(456, 20, 54, 81); 54 | punch[2] = image.getSubimage(521, 5, 49, 96); 55 | return punch; 56 | } 57 | 58 | int punchIndex = 0; 59 | 60 | public void printPunch(Graphics g) { 61 | 62 | if(timeIndex>=3) { 63 | 64 | punchIndex++; 65 | timeIndex=0; 66 | } 67 | if(punchIndex>=3) { 68 | punchIndex=0; 69 | state = MOVE; 70 | } 71 | g.drawImage(punch[punchIndex],x,y,w,h,null); 72 | //moveIndex++; 73 | timeIndex++; 74 | } 75 | 76 | 77 | int moveIndex = 0; 78 | int timeIndex = 0; 79 | public void printDefaultMove(Graphics g) { 80 | 81 | if(timeIndex>=3) { 82 | 83 | moveIndex++; 84 | timeIndex=0; 85 | } 86 | if(moveIndex>=4) { 87 | moveIndex=0; 88 | } 89 | g.drawImage(def[moveIndex],x,y,w,h,null); 90 | //moveIndex++; 91 | timeIndex++; 92 | } 93 | @Override 94 | public void draw(Graphics g) { 95 | if(state == PUNCH) { 96 | printPunch(g); 97 | } 98 | else { 99 | printDefaultMove(g); 100 | } 101 | } 102 | 103 | 104 | public ArrayList getBullets() { 105 | return bullets; 106 | } 107 | 108 | public void setBullets(ArrayList bullets) { 109 | this.bullets = bullets; 110 | } 111 | 112 | public void fire() { 113 | Bullet bullet = new Bullet((x+this.getW()/2+10), (y+(this.getH()/2-30))); 114 | bullets.add(bullet); 115 | } 116 | 117 | public void jump() { 118 | if(!isJumped) { 119 | force = DEFAULT_FORCE; 120 | y = y + force; 121 | isJumped = true; 122 | } 123 | } 124 | 125 | public void fall() { 126 | if(y>=FLOOR-h) { 127 | isJumped = false; 128 | y = FLOOR - h; 129 | } 130 | else { 131 | force = force + GRAVITY; 132 | y = y + force; 133 | } 134 | } 135 | 136 | 137 | 138 | 139 | 140 | } 141 | -------------------------------------------------------------------------------- /v4/src/com/brainmentors/billing/main/DashBoard.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.billing.main; 2 | 3 | import java.awt.Color; 4 | import java.awt.Font; 5 | import java.awt.event.ActionEvent; 6 | import java.awt.event.ActionListener; 7 | import java.io.File; 8 | import java.io.IOException; 9 | import java.sql.SQLException; 10 | import java.util.ArrayList; 11 | 12 | import javax.swing.JFileChooser; 13 | import javax.swing.JFrame; 14 | import javax.swing.JLabel; 15 | import javax.swing.JMenu; 16 | import javax.swing.JMenuBar; 17 | import javax.swing.JMenuItem; 18 | import javax.swing.JOptionPane; 19 | import javax.swing.JPanel; 20 | import javax.swing.border.EmptyBorder; 21 | 22 | import com.brainmentors.billing.model.Product; 23 | import com.brainmentors.billing.model.ProductDAO; 24 | import com.brainmentors.billing.utils.ConfigReader; 25 | import com.brainmentors.billing.utils.ExcelReader; 26 | 27 | public class DashBoard extends JFrame { 28 | 29 | private JPanel contentPane; 30 | 31 | private void doUpload() { 32 | JFileChooser browse = 33 | new JFileChooser(ConfigReader.getValue(ConfigReader.BROWSE_PATH)); 34 | browse.showOpenDialog(this); 35 | File file = browse.getSelectedFile(); 36 | try { 37 | ArrayList productList = ExcelReader.readXLS(file); 38 | String msg = ProductDAO.bulkUpload(productList)?"Record Uploaded":"Not Uploaded"; 39 | JOptionPane.showMessageDialog(this, msg); 40 | } catch (IOException e) { 41 | // TODO Auto-generated catch block 42 | e.printStackTrace(); 43 | } 44 | catch (SQLException|ClassNotFoundException e) { 45 | // TODO Auto-generated catch block 46 | e.printStackTrace(); 47 | } 48 | System.out.println(file.getPath()); 49 | } 50 | 51 | private void createMenu() { 52 | JMenuBar menuBar = new JMenuBar(); 53 | this.setJMenuBar(menuBar); 54 | JMenu admin =new JMenu("Admin"); 55 | menuBar.add(admin); 56 | JMenuItem upload = new JMenuItem("Upload"); 57 | JMenuItem bill = new JMenuItem("Billing"); 58 | bill.addActionListener(new ActionListener() { 59 | public void actionPerformed(ActionEvent e) { 60 | BillingScreen billingScreen = new BillingScreen(); 61 | billingScreen.setVisible(true); 62 | } 63 | }); 64 | upload.addActionListener(new ActionListener() { 65 | public void actionPerformed(ActionEvent e) { 66 | doUpload(); 67 | } 68 | }); 69 | admin.add(upload); 70 | admin.addSeparator(); 71 | admin.add(bill); 72 | admin.addSeparator(); 73 | JMenuItem exit = new JMenuItem("Exit"); 74 | admin.add(exit); 75 | 76 | 77 | } 78 | 79 | 80 | 81 | /** 82 | * Create the frame. 83 | */ 84 | public DashBoard(String userid) { 85 | setTitle("DASHBOARD"); 86 | setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 87 | setBounds(100, 100, 450, 300); 88 | contentPane = new JPanel(); 89 | contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); 90 | setContentPane(contentPane); 91 | contentPane.setLayout(null); 92 | 93 | JLabel welcomelbl = new JLabel("Welcome "+userid); 94 | welcomelbl.setForeground(Color.RED); 95 | welcomelbl.setFont(new Font("Lucida Grande", Font.BOLD, 18)); 96 | welcomelbl.setBounds(22, 6, 264, 39); 97 | contentPane.add(welcomelbl); 98 | createMenu(); 99 | } 100 | 101 | } 102 | -------------------------------------------------------------------------------- /v5/src/com/brainmentors/billing/main/DashBoard.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.billing.main; 2 | 3 | import java.awt.Color; 4 | import java.awt.Font; 5 | import java.awt.event.ActionEvent; 6 | import java.awt.event.ActionListener; 7 | import java.io.File; 8 | import java.io.IOException; 9 | import java.sql.SQLException; 10 | import java.util.ArrayList; 11 | 12 | import javax.swing.JFileChooser; 13 | import javax.swing.JFrame; 14 | import javax.swing.JLabel; 15 | import javax.swing.JMenu; 16 | import javax.swing.JMenuBar; 17 | import javax.swing.JMenuItem; 18 | import javax.swing.JOptionPane; 19 | import javax.swing.JPanel; 20 | import javax.swing.border.EmptyBorder; 21 | 22 | import com.brainmentors.billing.model.Product; 23 | import com.brainmentors.billing.model.ProductDAO; 24 | import com.brainmentors.billing.utils.ConfigReader; 25 | import com.brainmentors.billing.utils.ExcelReader; 26 | 27 | public class DashBoard extends JFrame { 28 | 29 | private JPanel contentPane; 30 | 31 | private void doUpload() { 32 | JFileChooser browse = 33 | new JFileChooser(ConfigReader.getValue(ConfigReader.BROWSE_PATH)); 34 | browse.showOpenDialog(this); 35 | File file = browse.getSelectedFile(); 36 | try { 37 | ArrayList productList = ExcelReader.readXLS(file); 38 | String msg = ProductDAO.bulkUpload(productList)?"Record Uploaded":"Not Uploaded"; 39 | JOptionPane.showMessageDialog(this, msg); 40 | } catch (IOException e) { 41 | // TODO Auto-generated catch block 42 | e.printStackTrace(); 43 | } 44 | catch (SQLException|ClassNotFoundException e) { 45 | // TODO Auto-generated catch block 46 | e.printStackTrace(); 47 | } 48 | System.out.println(file.getPath()); 49 | } 50 | 51 | private void createMenu() { 52 | JMenuBar menuBar = new JMenuBar(); 53 | this.setJMenuBar(menuBar); 54 | JMenu admin =new JMenu("Admin"); 55 | menuBar.add(admin); 56 | JMenuItem upload = new JMenuItem("Upload"); 57 | JMenuItem bill = new JMenuItem("Billing"); 58 | bill.addActionListener(new ActionListener() { 59 | public void actionPerformed(ActionEvent e) { 60 | BillingScreen billingScreen = new BillingScreen(); 61 | billingScreen.setVisible(true); 62 | } 63 | }); 64 | upload.addActionListener(new ActionListener() { 65 | public void actionPerformed(ActionEvent e) { 66 | doUpload(); 67 | } 68 | }); 69 | admin.add(upload); 70 | admin.addSeparator(); 71 | admin.add(bill); 72 | admin.addSeparator(); 73 | JMenuItem exit = new JMenuItem("Exit"); 74 | admin.add(exit); 75 | 76 | 77 | } 78 | 79 | 80 | 81 | /** 82 | * Create the frame. 83 | */ 84 | public DashBoard(String userid) { 85 | setTitle("DASHBOARD"); 86 | setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 87 | setBounds(100, 100, 450, 300); 88 | contentPane = new JPanel(); 89 | contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); 90 | setContentPane(contentPane); 91 | contentPane.setLayout(null); 92 | 93 | JLabel welcomelbl = new JLabel("Welcome "+userid); 94 | welcomelbl.setForeground(Color.RED); 95 | welcomelbl.setFont(new Font("Lucida Grande", Font.BOLD, 18)); 96 | welcomelbl.setBounds(22, 6, 264, 39); 97 | contentPane.add(welcomelbl); 98 | createMenu(); 99 | } 100 | 101 | } 102 | -------------------------------------------------------------------------------- /Student.java: -------------------------------------------------------------------------------- 1 | 2 | public class Student { 3 | private int id; // Instance Variable 4 | private String name; 5 | private String course; 6 | private String phone; 7 | private int marks[]= new int[3]; 8 | 9 | //Student(){} 10 | 11 | 12 | void Student() { 13 | System.out.println("I am a Method Not a " 14 | + "Constructor U need to call me"); 15 | } 16 | 17 | 18 | public int getId() { 19 | return id; 20 | } 21 | 22 | 23 | public String getName() { 24 | return name; 25 | } 26 | 27 | public void setName(String name) { 28 | this.name = name; 29 | } 30 | 31 | public String getCourse() { 32 | return course; 33 | } 34 | 35 | public void setCourse(String course) { 36 | this.course = course; 37 | } 38 | 39 | public String getPhone() { 40 | return phone; 41 | } 42 | 43 | public void setPhone(String phone) { 44 | this.phone = phone; 45 | } 46 | 47 | public int[] getMarks() { 48 | return marks; 49 | } 50 | 51 | public void setMarks(int[] marks) { 52 | this.marks = marks; 53 | } 54 | 55 | // Constructor overloading 56 | // Default 57 | Student(){ 58 | //System.out.println("Default Cons Call"); 59 | course = "Java"; 60 | 61 | } 62 | Student (int id, String name){ 63 | this(); // Calling must be on first line 64 | this.id = id ; 65 | //StringUtil sb = new StringUtil(); 66 | //this.name = sb.titleCase(name); 67 | this.name = StringUtil.titleCase(name); 68 | } 69 | // Param 70 | Student(int id, String name , String phone, int marks[]){ 71 | //this(); // Default Constructor Calling 72 | this(id, name); 73 | // this.id = id; 74 | // this.name = name; 75 | this.phone = phone; 76 | this.marks = marks; 77 | } 78 | public String printReport() { 79 | String markStr = ""; 80 | for(int mark:marks) { 81 | markStr+= mark +"\n"; 82 | } 83 | return "Id "+id+ " Name "+name+"\n" 84 | +"Course "+course+" Phone "+phone+"\n" 85 | +"Marks are \n"+markStr+ 86 | "Total "+total()+" Percentage "+per()+ 87 | "\nGrade "+grade(); 88 | } 89 | private double per() { 90 | return total()/marks.length; 91 | } 92 | private String grade() { 93 | double percentage = per(); 94 | if(percentage>=90) { 95 | return "A Grade"; 96 | } 97 | else 98 | if(percentage<90 && percentage>=70) { 99 | return "B Grade"; 100 | } 101 | else 102 | if(percentage<70 && percentage>=60) { 103 | return "C Grade"; 104 | } 105 | else { 106 | return "D Grade"; 107 | } 108 | } 109 | private int total() { 110 | int sum = 0; 111 | for(int mark : marks) { 112 | sum+=mark; 113 | } 114 | return sum; 115 | } 116 | 117 | // Initalize 118 | // Local Var 119 | public void takeInput(int id , String name, String course , String phone) { 120 | // Instance Var = Local Var 121 | if(id<=0) { 122 | System.out.println("Id is Invalid"); 123 | return ; 124 | } 125 | this.id = id; 126 | this.name = name; 127 | this.course = course; 128 | this.phone = phone; 129 | } 130 | /* 131 | public void print() { 132 | // this 133 | System.out.println("Id is "+this.id); 134 | System.out.println("Name is "+name); 135 | System.out.println("Course "+course); 136 | System.out.println("Phone "+this.phone); 137 | }*/ 138 | 139 | } 140 | -------------------------------------------------------------------------------- /v4/src/com/brainmentors/billing/model/ProductDAO.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.billing.model; 2 | 3 | import java.sql.Connection; 4 | import java.sql.PreparedStatement; 5 | import java.sql.ResultSet; 6 | import java.sql.SQLException; 7 | import java.util.ArrayList; 8 | 9 | import com.brainmentors.billing.utils.CommonDAO; 10 | 11 | public interface ProductDAO extends CommonDAO { 12 | 13 | public static Product getProductByName(String name) throws ClassNotFoundException, SQLException { 14 | Connection con = null; 15 | PreparedStatement pstmt = null; 16 | ResultSet rs = null; 17 | Product product = null; 18 | try { 19 | con = CommonDAO.getConnection(); 20 | pstmt = con.prepareStatement("select name, " 21 | + "price, descr, imgpath," 22 | + " qt from product_mst where name=?"); 23 | pstmt.setString(1, name); 24 | rs = pstmt.executeQuery(); 25 | if(rs.next()) { 26 | product= new Product(); 27 | product.setName(rs.getString("name")); 28 | product.setDesc(rs.getString("descr")); 29 | product.setPrice(rs.getDouble("price")); 30 | product.setQuantity(rs.getInt("qt")); 31 | product.setPath(rs.getString("imgpath")); 32 | } 33 | 34 | 35 | } 36 | finally { 37 | if(rs!=null) { 38 | rs.close(); 39 | } 40 | if(pstmt!=null) { 41 | pstmt.close(); 42 | } 43 | } 44 | return product; 45 | 46 | } 47 | 48 | public static ArrayList getProductNames() throws ClassNotFoundException, SQLException{ 49 | 50 | ArrayList names = new ArrayList<>(); 51 | Connection con = null; 52 | PreparedStatement pstmt = null; 53 | ResultSet rs = null; 54 | try { 55 | con = CommonDAO.getConnection(); 56 | pstmt = con.prepareStatement("select name from product_mst"); 57 | rs = pstmt.executeQuery(); 58 | while(rs.next()) { 59 | names.add(rs.getString("name")); 60 | } 61 | } 62 | finally { 63 | if(rs!=null) { 64 | rs.close(); 65 | } 66 | if(pstmt!=null) { 67 | pstmt.close(); 68 | } 69 | } 70 | return names; 71 | } 72 | public static boolean bulkUpload(ArrayList productList) throws ClassNotFoundException, SQLException { 73 | Connection con = null; 74 | PreparedStatement pstmt = null; 75 | if(productList==null) { 76 | return false; 77 | } 78 | if(productList.size()==0) { 79 | return false; 80 | } 81 | 82 | con = CommonDAO.getConnection(); 83 | con.setAutoCommit(false); 84 | pstmt = con.prepareStatement("insert into product_mst " 85 | + "(id, name, descr, price, imgpath, qt) values(?,?,?,?,?,?) "); 86 | for(Product product :productList) { 87 | pstmt.setInt(1,product.getId() ); 88 | pstmt.setString(2, product.getName()); 89 | pstmt.setString(3, product.getDesc()); 90 | pstmt.setDouble(4, product.getPrice()); 91 | pstmt.setString(5, product.getPath()); 92 | pstmt.setInt(6, product.getQuantity()); 93 | pstmt.addBatch(); 94 | 95 | } 96 | 97 | int results[] = pstmt.executeBatch(); 98 | boolean rollBack = false; 99 | for(int r : results) { 100 | if(r<=0) { 101 | rollBack = true; 102 | break; 103 | } 104 | } 105 | if(rollBack) { 106 | con.rollback(); 107 | return false; 108 | } 109 | else { 110 | con.commit(); 111 | return true; 112 | } 113 | } 114 | 115 | } 116 | -------------------------------------------------------------------------------- /jquery/jquery-ui.structure.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery UI CSS Framework 1.12.1 3 | * http://jqueryui.com 4 | * 5 | * Copyright jQuery Foundation and other contributors 6 | * Released under the MIT license. 7 | * http://jquery.org/license 8 | * 9 | * http://api.jqueryui.com/category/theming/ 10 | */ 11 | /* Layout helpers 12 | ----------------------------------*/ 13 | .ui-helper-hidden { 14 | display: none; 15 | } 16 | .ui-helper-hidden-accessible { 17 | border: 0; 18 | clip: rect(0 0 0 0); 19 | height: 1px; 20 | margin: -1px; 21 | overflow: hidden; 22 | padding: 0; 23 | position: absolute; 24 | width: 1px; 25 | } 26 | .ui-helper-reset { 27 | margin: 0; 28 | padding: 0; 29 | border: 0; 30 | outline: 0; 31 | line-height: 1.3; 32 | text-decoration: none; 33 | font-size: 100%; 34 | list-style: none; 35 | } 36 | .ui-helper-clearfix:before, 37 | .ui-helper-clearfix:after { 38 | content: ""; 39 | display: table; 40 | border-collapse: collapse; 41 | } 42 | .ui-helper-clearfix:after { 43 | clear: both; 44 | } 45 | .ui-helper-zfix { 46 | width: 100%; 47 | height: 100%; 48 | top: 0; 49 | left: 0; 50 | position: absolute; 51 | opacity: 0; 52 | filter:Alpha(Opacity=0); /* support: IE8 */ 53 | } 54 | 55 | .ui-front { 56 | z-index: 100; 57 | } 58 | 59 | 60 | /* Interaction Cues 61 | ----------------------------------*/ 62 | .ui-state-disabled { 63 | cursor: default !important; 64 | pointer-events: none; 65 | } 66 | 67 | 68 | /* Icons 69 | ----------------------------------*/ 70 | .ui-icon { 71 | display: inline-block; 72 | vertical-align: middle; 73 | margin-top: -.25em; 74 | position: relative; 75 | text-indent: -99999px; 76 | overflow: hidden; 77 | background-repeat: no-repeat; 78 | } 79 | 80 | .ui-widget-icon-block { 81 | left: 50%; 82 | margin-left: -8px; 83 | display: block; 84 | } 85 | 86 | /* Misc visuals 87 | ----------------------------------*/ 88 | 89 | /* Overlays */ 90 | .ui-widget-overlay { 91 | position: fixed; 92 | top: 0; 93 | left: 0; 94 | width: 100%; 95 | height: 100%; 96 | } 97 | .ui-autocomplete { 98 | position: absolute; 99 | top: 0; 100 | left: 0; 101 | cursor: default; 102 | } 103 | .ui-menu { 104 | list-style: none; 105 | padding: 0; 106 | margin: 0; 107 | display: block; 108 | outline: 0; 109 | } 110 | .ui-menu .ui-menu { 111 | position: absolute; 112 | } 113 | .ui-menu .ui-menu-item { 114 | margin: 0; 115 | cursor: pointer; 116 | /* support: IE10, see #8844 */ 117 | list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"); 118 | } 119 | .ui-menu .ui-menu-item-wrapper { 120 | position: relative; 121 | padding: 3px 1em 3px .4em; 122 | } 123 | .ui-menu .ui-menu-divider { 124 | margin: 5px 0; 125 | height: 0; 126 | font-size: 0; 127 | line-height: 0; 128 | border-width: 1px 0 0 0; 129 | } 130 | .ui-menu .ui-state-focus, 131 | .ui-menu .ui-state-active { 132 | margin: -1px; 133 | } 134 | 135 | /* icon support */ 136 | .ui-menu-icons { 137 | position: relative; 138 | } 139 | .ui-menu-icons .ui-menu-item-wrapper { 140 | padding-left: 2em; 141 | } 142 | 143 | /* left-aligned */ 144 | .ui-menu .ui-icon { 145 | position: absolute; 146 | top: 0; 147 | bottom: 0; 148 | left: .2em; 149 | margin: auto 0; 150 | } 151 | 152 | /* right-aligned */ 153 | .ui-menu .ui-menu-icon { 154 | left: auto; 155 | right: 0; 156 | } 157 | -------------------------------------------------------------------------------- /v5/src/com/brainmentors/billing/model/ProductDAO.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.billing.model; 2 | 3 | import java.sql.Connection; 4 | import java.sql.PreparedStatement; 5 | import java.sql.ResultSet; 6 | import java.sql.SQLException; 7 | import java.util.ArrayList; 8 | 9 | import org.apache.commons.codec.language.bm.Rule.RPattern; 10 | 11 | import com.brainmentors.billing.utils.CommonDAO; 12 | 13 | public interface ProductDAO extends CommonDAO { 14 | 15 | public static Product getProductByName(String name) throws ClassNotFoundException, SQLException { 16 | Connection con = null; 17 | PreparedStatement pstmt = null; 18 | ResultSet rs = null; 19 | Product product = null; 20 | try { 21 | con = CommonDAO.getConnection(); 22 | pstmt = con.prepareStatement("select id, name, " 23 | + "price, descr, imgpath," 24 | + " qt from product_mst where name=?"); 25 | pstmt.setString(1, name); 26 | rs = pstmt.executeQuery(); 27 | if(rs.next()) { 28 | product= new Product(); 29 | product.setId(rs.getInt("id")); 30 | product.setName(rs.getString("name")); 31 | product.setDesc(rs.getString("descr")); 32 | product.setPrice(rs.getDouble("price")); 33 | product.setQuantity(rs.getInt("qt")); 34 | product.setPath(rs.getString("imgpath")); 35 | } 36 | 37 | 38 | } 39 | finally { 40 | if(rs!=null) { 41 | rs.close(); 42 | } 43 | if(pstmt!=null) { 44 | pstmt.close(); 45 | } 46 | } 47 | return product; 48 | 49 | } 50 | 51 | public static ArrayList getProductNames() throws ClassNotFoundException, SQLException{ 52 | 53 | ArrayList names = new ArrayList<>(); 54 | Connection con = null; 55 | PreparedStatement pstmt = null; 56 | ResultSet rs = null; 57 | try { 58 | con = CommonDAO.getConnection(); 59 | pstmt = con.prepareStatement("select name from product_mst"); 60 | rs = pstmt.executeQuery(); 61 | while(rs.next()) { 62 | names.add(rs.getString("name")); 63 | } 64 | } 65 | finally { 66 | if(rs!=null) { 67 | rs.close(); 68 | } 69 | if(pstmt!=null) { 70 | pstmt.close(); 71 | } 72 | } 73 | return names; 74 | } 75 | public static boolean bulkUpload(ArrayList productList) throws ClassNotFoundException, SQLException { 76 | Connection con = null; 77 | PreparedStatement pstmt = null; 78 | if(productList==null) { 79 | return false; 80 | } 81 | if(productList.size()==0) { 82 | return false; 83 | } 84 | 85 | con = CommonDAO.getConnection(); 86 | con.setAutoCommit(false); 87 | pstmt = con.prepareStatement("insert into product_mst " 88 | + "(id, name, descr, price, imgpath, qt) values(?,?,?,?,?,?) "); 89 | for(Product product :productList) { 90 | pstmt.setInt(1,product.getId() ); 91 | pstmt.setString(2, product.getName()); 92 | pstmt.setString(3, product.getDesc()); 93 | pstmt.setDouble(4, product.getPrice()); 94 | pstmt.setString(5, product.getPath()); 95 | pstmt.setInt(6, product.getQuantity()); 96 | pstmt.addBatch(); 97 | 98 | } 99 | 100 | int results[] = pstmt.executeBatch(); 101 | boolean rollBack = false; 102 | for(int r : results) { 103 | if(r<=0) { 104 | rollBack = true; 105 | break; 106 | } 107 | } 108 | if(rollBack) { 109 | con.rollback(); 110 | return false; 111 | } 112 | else { 113 | con.commit(); 114 | return true; 115 | } 116 | } 117 | 118 | } 119 | -------------------------------------------------------------------------------- /gaming/Board.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.gaming; 2 | 3 | import java.awt.Color; 4 | import java.awt.Graphics; 5 | import java.awt.event.KeyAdapter; 6 | import java.awt.event.KeyEvent; 7 | import java.awt.image.BufferedImage; 8 | 9 | import javax.swing.JPanel; 10 | import javax.swing.Timer; 11 | 12 | public class Board extends JPanel implements GameConstants{ 13 | Player player; 14 | private Timer timer; 15 | Enemy enemies [] = new Enemy[MAX_ENEMIES]; 16 | BufferedImage enemyImages[] = new BufferedImage[MAX_ENEMIES]; 17 | private void loadEnemiesImages() { 18 | enemyImages[0] = ImageLoader.loadImage(ENEMY_IMG1); 19 | enemyImages[1] = ImageLoader.loadImage(ENEMY_IMG2); 20 | enemyImages[2] = ImageLoader.loadImage(ENEMY_IMG3); 21 | } 22 | private void loadEnemies() { 23 | int speed = -10; 24 | int diff = 0; 25 | int gap = 1; 26 | for(int i = 0 ; i{ 78 | //player.move(); 79 | player.fall(); 80 | repaint(); 81 | }); 82 | timer.start(); 83 | // Anonymous Style 84 | // timer = new Timer(50,new ActionListener() { 85 | // 86 | // @Override 87 | // public void actionPerformed(ActionEvent e) { 88 | // // TODO Auto-generated method stub 89 | // 90 | // } 91 | // }); 92 | } 93 | 94 | private void drawEnemies(Graphics g) { 95 | for(Enemy en: enemies) { 96 | en.draw(g); 97 | en.move(); 98 | } 99 | } 100 | 101 | public Board() { 102 | loadEnemiesImages(); 103 | loadEnemies(); 104 | setFocusable(true); 105 | registerEvents(); 106 | player = new Player(); 107 | setSize(GWIDTH, GHEIGHT); 108 | setBackground(Color.BLACK); 109 | gameLoop(); 110 | } 111 | 112 | private void drawBackground(Graphics g) { 113 | BufferedImage image = ImageLoader.loadImage(BACKGROUND_IMAGE); 114 | g.drawImage(image, 0, 0, GWIDTH, GHEIGHT, null); 115 | } 116 | 117 | @Override 118 | protected void paintComponent(Graphics g) { 119 | // TODO Auto-generated method stub 120 | super.paintComponent(g); 121 | // Paint Job 122 | drawBackground(g); 123 | player.draw(g); 124 | drawEnemies(g); 125 | } 126 | 127 | 128 | 129 | 130 | } 131 | -------------------------------------------------------------------------------- /deprecated-list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Deprecated List 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 22 | 34 | 37 |
38 | 76 |
77 |
78 |
79 |

Deprecated API

80 |

Contents

81 |
82 |
83 | 108 | 109 | 110 | -------------------------------------------------------------------------------- /constant-values.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Constant Field Values 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 22 | 34 | 37 |
38 | 76 |
77 |
78 |
79 |

Constant Field Values

80 |
81 |

Contents

82 |
83 |
84 |
85 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /v2/src/com/brainmentors/billing/user/Register.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.billing.user; 2 | 3 | import java.awt.BorderLayout; 4 | import java.awt.EventQueue; 5 | 6 | import javax.swing.JFrame; 7 | import javax.swing.JPanel; 8 | import javax.swing.border.EmptyBorder; 9 | import javax.swing.JLabel; 10 | import javax.swing.JOptionPane; 11 | 12 | import java.awt.Font; 13 | import java.awt.Color; 14 | import javax.swing.SwingConstants; 15 | import javax.swing.JTextField; 16 | import javax.swing.JPasswordField; 17 | import javax.swing.JButton; 18 | import javax.swing.ImageIcon; 19 | import java.awt.event.ActionListener; 20 | import java.sql.SQLException; 21 | import java.awt.event.ActionEvent; 22 | 23 | public class Register extends JFrame { 24 | 25 | private JPanel contentPane; 26 | private JTextField textField; 27 | private JPasswordField passwordField; 28 | 29 | private void back() { 30 | this.setVisible(false); 31 | this.dispose(); 32 | Login login = new Login(); 33 | login.setVisible(true); 34 | } 35 | 36 | 37 | private void register() { 38 | String userid = textField.getText(); 39 | 40 | String password = new String(passwordField.getPassword()); 41 | UserDAO userDAO = new UserDAO(); 42 | try { 43 | if(userDAO.isUserExist(userid)) { 44 | JOptionPane.showMessageDialog(this, "user already exist"); 45 | return ; 46 | } 47 | boolean isAdded = userDAO.register(userid, password); 48 | JOptionPane.showMessageDialog(this 49 | , isAdded?"Record Added":"Not Added"); 50 | } catch (ClassNotFoundException e) { 51 | // TODO Auto-generated catch block 52 | e.printStackTrace(); 53 | } catch (SQLException e) { 54 | // TODO Auto-generated catch block 55 | e.printStackTrace(); 56 | } 57 | } 58 | 59 | 60 | public Register() { 61 | setResizable(false); 62 | setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 63 | setBounds(100, 100, 369, 300); 64 | contentPane = new JPanel(); 65 | contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); 66 | setContentPane(contentPane); 67 | contentPane.setLayout(null); 68 | 69 | JLabel lblNewLabel = new JLabel("Register"); 70 | lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER); 71 | lblNewLabel.setForeground(Color.RED); 72 | lblNewLabel.setFont(new Font("Lucida Grande", Font.BOLD, 20)); 73 | lblNewLabel.setBounds(112, 45, 119, 40); 74 | contentPane.add(lblNewLabel); 75 | 76 | JLabel lblUserid = new JLabel("Userid"); 77 | lblUserid.setFont(new Font("Lucida Grande", Font.PLAIN, 16)); 78 | lblUserid.setBounds(27, 109, 61, 16); 79 | contentPane.add(lblUserid); 80 | 81 | JLabel lblPassword = new JLabel("Password"); 82 | lblPassword.setFont(new Font("Lucida Grande", Font.PLAIN, 16)); 83 | lblPassword.setBounds(27, 163, 84, 16); 84 | contentPane.add(lblPassword); 85 | 86 | textField = new JTextField(); 87 | textField.setBounds(101, 105, 159, 26); 88 | contentPane.add(textField); 89 | textField.setColumns(10); 90 | 91 | passwordField = new JPasswordField(); 92 | passwordField.setEchoChar('#'); 93 | passwordField.setBounds(112, 159, 136, 26); 94 | contentPane.add(passwordField); 95 | 96 | JButton btnLogin = new JButton("Register"); 97 | btnLogin.addActionListener(new ActionListener() { 98 | public void actionPerformed(ActionEvent e) { 99 | register(); 100 | } 101 | }); 102 | btnLogin.setIcon(new ImageIcon(Login.class.getResource("/com/brainmentors/billing/user/login.png"))); 103 | btnLogin.setBounds(6, 209, 119, 48); 104 | contentPane.add(btnLogin); 105 | 106 | JButton btnReset = new JButton("Reset"); 107 | btnReset.setBounds(122, 219, 117, 29); 108 | contentPane.add(btnReset); 109 | 110 | JButton btnBack = new JButton("Back"); 111 | btnBack.addActionListener(new ActionListener() { 112 | public void actionPerformed(ActionEvent e) { 113 | back(); 114 | } 115 | }); 116 | btnBack.setBounds(8, 4, 117, 29); 117 | contentPane.add(btnBack); 118 | 119 | 120 | 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /v3/src/com/brainmentors/billing/user/Register.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.billing.user; 2 | 3 | import java.awt.BorderLayout; 4 | import java.awt.EventQueue; 5 | 6 | import javax.swing.JFrame; 7 | import javax.swing.JPanel; 8 | import javax.swing.border.EmptyBorder; 9 | import javax.swing.JLabel; 10 | import javax.swing.JOptionPane; 11 | 12 | import java.awt.Font; 13 | import java.awt.Color; 14 | import javax.swing.SwingConstants; 15 | import javax.swing.JTextField; 16 | import javax.swing.JPasswordField; 17 | import javax.swing.JButton; 18 | import javax.swing.ImageIcon; 19 | import java.awt.event.ActionListener; 20 | import java.sql.SQLException; 21 | import java.awt.event.ActionEvent; 22 | 23 | public class Register extends JFrame { 24 | 25 | private JPanel contentPane; 26 | private JTextField textField; 27 | private JPasswordField passwordField; 28 | 29 | private void back() { 30 | this.setVisible(false); 31 | this.dispose(); 32 | Login login = new Login(); 33 | login.setVisible(true); 34 | } 35 | 36 | 37 | private void register() { 38 | String userid = textField.getText(); 39 | 40 | String password = new String(passwordField.getPassword()); 41 | UserDAO userDAO = new UserDAO(); 42 | try { 43 | if(userDAO.isUserExist(userid)) { 44 | JOptionPane.showMessageDialog(this, "user already exist"); 45 | return ; 46 | } 47 | boolean isAdded = userDAO.register(userid, password); 48 | JOptionPane.showMessageDialog(this 49 | , isAdded?"Record Added":"Not Added"); 50 | } catch (ClassNotFoundException e) { 51 | // TODO Auto-generated catch block 52 | e.printStackTrace(); 53 | } catch (SQLException e) { 54 | // TODO Auto-generated catch block 55 | e.printStackTrace(); 56 | } 57 | } 58 | 59 | 60 | public Register() { 61 | setResizable(false); 62 | setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 63 | setBounds(100, 100, 369, 300); 64 | contentPane = new JPanel(); 65 | contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); 66 | setContentPane(contentPane); 67 | contentPane.setLayout(null); 68 | 69 | JLabel lblNewLabel = new JLabel("Register"); 70 | lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER); 71 | lblNewLabel.setForeground(Color.RED); 72 | lblNewLabel.setFont(new Font("Lucida Grande", Font.BOLD, 20)); 73 | lblNewLabel.setBounds(112, 45, 119, 40); 74 | contentPane.add(lblNewLabel); 75 | 76 | JLabel lblUserid = new JLabel("Userid"); 77 | lblUserid.setFont(new Font("Lucida Grande", Font.PLAIN, 16)); 78 | lblUserid.setBounds(27, 109, 61, 16); 79 | contentPane.add(lblUserid); 80 | 81 | JLabel lblPassword = new JLabel("Password"); 82 | lblPassword.setFont(new Font("Lucida Grande", Font.PLAIN, 16)); 83 | lblPassword.setBounds(27, 163, 84, 16); 84 | contentPane.add(lblPassword); 85 | 86 | textField = new JTextField(); 87 | textField.setBounds(101, 105, 159, 26); 88 | contentPane.add(textField); 89 | textField.setColumns(10); 90 | 91 | passwordField = new JPasswordField(); 92 | passwordField.setEchoChar('#'); 93 | passwordField.setBounds(112, 159, 136, 26); 94 | contentPane.add(passwordField); 95 | 96 | JButton btnLogin = new JButton("Register"); 97 | btnLogin.addActionListener(new ActionListener() { 98 | public void actionPerformed(ActionEvent e) { 99 | register(); 100 | } 101 | }); 102 | btnLogin.setIcon(new ImageIcon(Login.class.getResource("/com/brainmentors/billing/user/login.png"))); 103 | btnLogin.setBounds(6, 209, 119, 48); 104 | contentPane.add(btnLogin); 105 | 106 | JButton btnReset = new JButton("Reset"); 107 | btnReset.setBounds(122, 219, 117, 29); 108 | contentPane.add(btnReset); 109 | 110 | JButton btnBack = new JButton("Back"); 111 | btnBack.addActionListener(new ActionListener() { 112 | public void actionPerformed(ActionEvent e) { 113 | back(); 114 | } 115 | }); 116 | btnBack.setBounds(8, 4, 117, 29); 117 | contentPane.add(btnBack); 118 | 119 | 120 | 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /v4/src/com/brainmentors/billing/user/Register.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.billing.user; 2 | 3 | import java.awt.BorderLayout; 4 | import java.awt.EventQueue; 5 | 6 | import javax.swing.JFrame; 7 | import javax.swing.JPanel; 8 | import javax.swing.border.EmptyBorder; 9 | import javax.swing.JLabel; 10 | import javax.swing.JOptionPane; 11 | 12 | import java.awt.Font; 13 | import java.awt.Color; 14 | import javax.swing.SwingConstants; 15 | import javax.swing.JTextField; 16 | import javax.swing.JPasswordField; 17 | import javax.swing.JButton; 18 | import javax.swing.ImageIcon; 19 | import java.awt.event.ActionListener; 20 | import java.sql.SQLException; 21 | import java.awt.event.ActionEvent; 22 | 23 | public class Register extends JFrame { 24 | 25 | private JPanel contentPane; 26 | private JTextField textField; 27 | private JPasswordField passwordField; 28 | 29 | private void back() { 30 | this.setVisible(false); 31 | this.dispose(); 32 | Login login = new Login(); 33 | login.setVisible(true); 34 | } 35 | 36 | 37 | private void register() { 38 | String userid = textField.getText(); 39 | 40 | String password = new String(passwordField.getPassword()); 41 | UserDAO userDAO = new UserDAO(); 42 | try { 43 | if(userDAO.isUserExist(userid)) { 44 | JOptionPane.showMessageDialog(this, "user already exist"); 45 | return ; 46 | } 47 | boolean isAdded = userDAO.register(userid, password); 48 | JOptionPane.showMessageDialog(this 49 | , isAdded?"Record Added":"Not Added"); 50 | } catch (ClassNotFoundException e) { 51 | // TODO Auto-generated catch block 52 | e.printStackTrace(); 53 | } catch (SQLException e) { 54 | // TODO Auto-generated catch block 55 | e.printStackTrace(); 56 | } 57 | } 58 | 59 | 60 | public Register() { 61 | setResizable(false); 62 | setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 63 | setBounds(100, 100, 369, 300); 64 | contentPane = new JPanel(); 65 | contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); 66 | setContentPane(contentPane); 67 | contentPane.setLayout(null); 68 | 69 | JLabel lblNewLabel = new JLabel("Register"); 70 | lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER); 71 | lblNewLabel.setForeground(Color.RED); 72 | lblNewLabel.setFont(new Font("Lucida Grande", Font.BOLD, 20)); 73 | lblNewLabel.setBounds(112, 45, 119, 40); 74 | contentPane.add(lblNewLabel); 75 | 76 | JLabel lblUserid = new JLabel("Userid"); 77 | lblUserid.setFont(new Font("Lucida Grande", Font.PLAIN, 16)); 78 | lblUserid.setBounds(27, 109, 61, 16); 79 | contentPane.add(lblUserid); 80 | 81 | JLabel lblPassword = new JLabel("Password"); 82 | lblPassword.setFont(new Font("Lucida Grande", Font.PLAIN, 16)); 83 | lblPassword.setBounds(27, 163, 84, 16); 84 | contentPane.add(lblPassword); 85 | 86 | textField = new JTextField(); 87 | textField.setBounds(101, 105, 159, 26); 88 | contentPane.add(textField); 89 | textField.setColumns(10); 90 | 91 | passwordField = new JPasswordField(); 92 | passwordField.setEchoChar('#'); 93 | passwordField.setBounds(112, 159, 136, 26); 94 | contentPane.add(passwordField); 95 | 96 | JButton btnLogin = new JButton("Register"); 97 | btnLogin.addActionListener(new ActionListener() { 98 | public void actionPerformed(ActionEvent e) { 99 | register(); 100 | } 101 | }); 102 | btnLogin.setIcon(new ImageIcon(Login.class.getResource("/com/brainmentors/billing/user/login.png"))); 103 | btnLogin.setBounds(6, 209, 119, 48); 104 | contentPane.add(btnLogin); 105 | 106 | JButton btnReset = new JButton("Reset"); 107 | btnReset.setBounds(122, 219, 117, 29); 108 | contentPane.add(btnReset); 109 | 110 | JButton btnBack = new JButton("Back"); 111 | btnBack.addActionListener(new ActionListener() { 112 | public void actionPerformed(ActionEvent e) { 113 | back(); 114 | } 115 | }); 116 | btnBack.setBounds(8, 4, 117, 29); 117 | contentPane.add(btnBack); 118 | 119 | 120 | 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /v5/src/com/brainmentors/billing/user/Register.java: -------------------------------------------------------------------------------- 1 | package com.brainmentors.billing.user; 2 | 3 | import java.awt.BorderLayout; 4 | import java.awt.EventQueue; 5 | 6 | import javax.swing.JFrame; 7 | import javax.swing.JPanel; 8 | import javax.swing.border.EmptyBorder; 9 | import javax.swing.JLabel; 10 | import javax.swing.JOptionPane; 11 | 12 | import java.awt.Font; 13 | import java.awt.Color; 14 | import javax.swing.SwingConstants; 15 | import javax.swing.JTextField; 16 | import javax.swing.JPasswordField; 17 | import javax.swing.JButton; 18 | import javax.swing.ImageIcon; 19 | import java.awt.event.ActionListener; 20 | import java.sql.SQLException; 21 | import java.awt.event.ActionEvent; 22 | 23 | public class Register extends JFrame { 24 | 25 | private JPanel contentPane; 26 | private JTextField textField; 27 | private JPasswordField passwordField; 28 | 29 | private void back() { 30 | this.setVisible(false); 31 | this.dispose(); 32 | Login login = new Login(); 33 | login.setVisible(true); 34 | } 35 | 36 | 37 | private void register() { 38 | String userid = textField.getText(); 39 | 40 | String password = new String(passwordField.getPassword()); 41 | UserDAO userDAO = new UserDAO(); 42 | try { 43 | if(userDAO.isUserExist(userid)) { 44 | JOptionPane.showMessageDialog(this, "user already exist"); 45 | return ; 46 | } 47 | boolean isAdded = userDAO.register(userid, password); 48 | JOptionPane.showMessageDialog(this 49 | , isAdded?"Record Added":"Not Added"); 50 | } catch (ClassNotFoundException e) { 51 | // TODO Auto-generated catch block 52 | e.printStackTrace(); 53 | } catch (SQLException e) { 54 | // TODO Auto-generated catch block 55 | e.printStackTrace(); 56 | } 57 | } 58 | 59 | 60 | public Register() { 61 | setResizable(false); 62 | setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); 63 | setBounds(100, 100, 369, 300); 64 | contentPane = new JPanel(); 65 | contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); 66 | setContentPane(contentPane); 67 | contentPane.setLayout(null); 68 | 69 | JLabel lblNewLabel = new JLabel("Register"); 70 | lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER); 71 | lblNewLabel.setForeground(Color.RED); 72 | lblNewLabel.setFont(new Font("Lucida Grande", Font.BOLD, 20)); 73 | lblNewLabel.setBounds(112, 45, 119, 40); 74 | contentPane.add(lblNewLabel); 75 | 76 | JLabel lblUserid = new JLabel("Userid"); 77 | lblUserid.setFont(new Font("Lucida Grande", Font.PLAIN, 16)); 78 | lblUserid.setBounds(27, 109, 61, 16); 79 | contentPane.add(lblUserid); 80 | 81 | JLabel lblPassword = new JLabel("Password"); 82 | lblPassword.setFont(new Font("Lucida Grande", Font.PLAIN, 16)); 83 | lblPassword.setBounds(27, 163, 84, 16); 84 | contentPane.add(lblPassword); 85 | 86 | textField = new JTextField(); 87 | textField.setBounds(101, 105, 159, 26); 88 | contentPane.add(textField); 89 | textField.setColumns(10); 90 | 91 | passwordField = new JPasswordField(); 92 | passwordField.setEchoChar('#'); 93 | passwordField.setBounds(112, 159, 136, 26); 94 | contentPane.add(passwordField); 95 | 96 | JButton btnLogin = new JButton("Register"); 97 | btnLogin.addActionListener(new ActionListener() { 98 | public void actionPerformed(ActionEvent e) { 99 | register(); 100 | } 101 | }); 102 | btnLogin.setIcon(new ImageIcon(Login.class.getResource("/com/brainmentors/billing/user/login.png"))); 103 | btnLogin.setBounds(6, 209, 119, 48); 104 | contentPane.add(btnLogin); 105 | 106 | JButton btnReset = new JButton("Reset"); 107 | btnReset.setBounds(122, 219, 117, 29); 108 | contentPane.add(btnReset); 109 | 110 | JButton btnBack = new JButton("Back"); 111 | btnBack.addActionListener(new ActionListener() { 112 | public void actionPerformed(ActionEvent e) { 113 | back(); 114 | } 115 | }); 116 | btnBack.setBounds(8, 4, 117, 29); 117 | contentPane.add(btnBack); 118 | 119 | 120 | 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /overview-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Class Hierarchy 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 22 | 34 | 37 |
38 | 76 |
77 |
78 |
79 |

Hierarchy For All Packages

80 |
81 |
82 |
83 |

Class Hierarchy

84 |
    85 |
  • java.lang.Object 86 | 89 |
  • 90 |
91 |
92 |
93 |
94 | 119 | 120 | 121 | -------------------------------------------------------------------------------- /package-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Class Hierarchy 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 22 | 34 | 37 |
38 | 76 |
77 |
78 |
79 |

Hierarchy For Package <Unnamed>

80 |
81 |
82 |
83 |

Class Hierarchy

84 |
    85 |
  • java.lang.Object 86 | 89 |
  • 90 |
91 |
92 |
93 |
94 | 119 | 120 | 121 | --------------------------------------------------------------------------------