
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
George John has Published 1081 Articles

George John
786 Views
Use the concept of DATE_SUB(). Let us first create a table −mysql> create table DemoTable ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, ArrivalDate datetime ); Query OK, 0 rows affected (1.02 sec)Note: Let’s say the current date is 2019-06-08Insert some records in the table using ... Read More

George John
618 Views
Let us first create a table −mysql> create table DemoTable ( Id int NOT NULL AUTO_INCREMENT PRIMARY KEY, StudentName varchar(20) ); Query OK, 0 rows affected (1.23 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(StudentName) values('John'); Query OK, 1 row affected ... Read More

George John
276 Views
To make JTable single selectable in Java, you need to set the selection mode to be SINGE_SELECTION. Let’s say the following is our table −String[][] rec = { { "001", "Shirts", "40" }, { "002", "Trousers", "250" }, { "003", "Jeans", "25" }, { "004", "Applicances", ... Read More

George John
525 Views
Let us first create a toolbar −JToolBar toolbar = new JToolBar();Now, set the orientation to create vertical toolbar −toolbar.setOrientation(SwingConstants.VERTICAL);The following is an example to create a vertical toolbar in Java −package my; import java.awt.BorderLayout; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JTextArea; import javax.swing.JToolBar; import javax.swing.SwingConstants; public class SwingDemo { public ... Read More

George John
307 Views
Here, we will see how to add a title to an existing Line border. Let’s say we have a label and the border is to be set −LineBorder linedBorder = new LineBorder(Color.blue); TitledBorder titledBorder = BorderFactory.createTitledBorder(linedBorder, "Demo Title"); JLabel label = new JLabel(); label.setBorder(titledBorder);The following is an example to add ... Read More

George John
47 Views
The placeholder attribute of the element is used to set a placeholder text in the textarea. A placeholder is considered as a hint, like “Enter you name”, “Enter mobile number”, “Write in 100 words”, etc.Following is the syntax−Above, text is the hint you want to set for the textarea ... Read More

George John
191 Views
Let us first create a collection with documents -> db.removingAnArrayElementDemo.insertOne({"UserMessage":["Hi", "Hello", "Bye"]}); { "acknowledged" : true, "insertedId" : ObjectId("5cef97bdef71edecf6a1f6a4") }Display all documents from a collection with the help of find() method -> db.removingAnArrayElementDemo.find().pretty();Output{ "_id" : ObjectId("5cef97bdef71edecf6a1f6a4"), "UserMessage" : [ "Hi", ... Read More

George John
482 Views
To set the row height of a JTree, use the setRowHeight() and as a parameter set the height in pixels −tree.setRowHeight(25);The following is an example to set the row height of a JTree with Java −package my; import javax.swing.JFrame; import javax.swing.JTree; import javax.swing.tree.DefaultMutableTreeNode; public class SwingDemo { public static ... Read More

George John
873 Views
The fill() method in HTML canvas is used to fill the current drawing path. The default is black. The element allows you to draw graphics on a web page using JavaScript. Every canvas has two elements that describes the height and width of the canvas i.e. height and width ... Read More

George John
270 Views
Python provides a very simple way of creating or publishing packages.Package management in Python is available through different tools−Pip- It remains one of the preferred choices because it virtually eliminates any manual installs and updates of software packages to operating systems. It manages full lists of packages and their corresponding ... Read More