Chandu yadav has Published 1091 Articles

Add two weeks to a date in MySQL?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:26

788 Views

To add two weeks to a date in MySQL, use DATE_ADD() −insert into yourTableName(yourColumnName) values(date_add(now(), interval 2 week));Let us first create a table −mysql> create table DemoTable    (    Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    ShippingDate datetime    ); Query OK, 0 rows affected (0.62 sec)Following is ... Read More

How to create a Confirmation Dialog Box in Java?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:26

4K+ Views

To create a confirmation dialog box in Java, use the Java Swing JOptionPane.showConfirmDialog() method, which allows you to create a dialog box that asks for confirmation from the user. For example, Do you want to restart the system?, “This file contains a virus, Do you want to still download?”, etc. ... Read More

MySQL query to fetch date with year and month?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:26

332 Views

For year and month date fetching, you can use YEAR() and MONTH() function in MySQL. Let us first create a table −mysql> create table DemoTable    (    Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    ShippingDate datetime    ); Query OK, 0 rows affected (0.48 sec)Insert some records in ... Read More

How to remove menus from MenuBar in Java?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:26

451 Views

Remove a menu from the MenuBar using the remove() method. Set the index for the menu you want to remove from the MenuBar.Let’s say we have the following two menus initially −The following is an example to remove one the above menus. Let’s say we are removing the 2nd menus ... Read More

str() vs repr() in Python?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:26

3K+ Views

Both str() and repr() methods in python are used for string representation of a string. Though they both seem to serve the same puppose, there is a little difference between them.Have you ever noticed what happens when you call a python built-in function str(x) where x is any object you ... Read More

Changing Class Members in Python?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:26

610 Views

Python object oriented programming allows variables to be used at the class level or the instance level where variables are simply the symbols denoting value you’re using in the program. At the class level, variables are referred to as class variables whereas variables at the instance level are referred to as ... Read More

HTML DOM Anchor href Property

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:26

181 Views

The HTML DOM Anchor href property is used to set or return the href attribute. It returns the url of the link.Following is the syntax to set the anchor href property−anchorObj.href = URLAbove, URL is the url of the link. It can be an absolute, relative or anchor link with ... Read More

Whatsapp using Python?

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:26

726 Views

In this section we are going to create a Whatsapp chatbots, but unlike few other chatbots for twitter or facebook, whatsapp chatbots don’t run on the platform directly because of whatsapp’s policies.But there is a way to get is done, using selenium, a very smart package in python with which ... Read More

Java Program to customize MenuBar and change the background color

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:26

2K+ Views

Use the UIManager to customize the MenuBar:JMenuBar menuBar = new JMenuBar(); UIManager.put("MenuBar.background", Color.ORANGE);We have used the following above to update the background color of the MenuBar:UIManager.put("MenuBar.background", Color.ORANGE);The following is an example to customize MenuBar and change the background color:package my; import java.awt.Color; import java.awt.event.KeyEvent; import javax.swing.JFrame; import javax.swing.JMenu; import javax.swing.JMenuBar; ... Read More

How to create a submenu for a Menu in Java

Chandu yadav

Chandu yadav

Updated on 30-Jul-2019 22:30:26

2K+ Views

Let us first create a MenuBar −JMenuBar menuBar = new JMenuBar(); UIManager.put("MenuBar.background", Color.ORANGE);To create a submenu for a Menu, the following is an example −Examplepackage my; import java.awt.Color; import java.awt.event.KeyEvent; import javax.swing.ButtonGroup; import javax.swing.JCheckBoxMenuItem; import javax.swing.JFrame; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JMenuItem; import javax.swing.JRadioButtonMenuItem; import javax.swing.UIManager; public class SwingDemo { ... Read More

Advertisements