Chandu yadav has Published 1163 Articles

Get the last days of all the months in MySQL?

Chandu yadav

Chandu yadav

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

87 Views

To get the last days of all the months, use the LAST_DAY() function from MySQL −SELECT LAST_DAY(yourColumnName) from yourTableName;Let us first create a table −mysql> create table DemoTable    (    ShippingDate date    ); Query OK, 0 rows affected (0.69 sec)Insert some records in the table using insert command ... Read More

Can we combine GridLayout and BorderLayout in Java?

Chandu yadav

Chandu yadav

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

418 Views

Yes, we can do that with Java Swings as shown below. Here, we have a panel set with GridLayout and another panel with BorderLayout −JPanel panelGrid = new JPanel(new GridLayout(10, 5, 10, 10)); panelGrid.add(new JCheckBox("Demo CheckBox1")); panelGrid.add(new JCheckBox("Demo CheckBox2")); panelGrid.add(btnAPanel); panelGrid.add(btnBPanel); panelGrid.add(btnCPanel); panelGrid.add(btnDPanel); JPanel panelBrdLayout = new JPanel(new BorderLayout()); panelBrdLayout.add(panelGrid, ... Read More

Program to get JTextArea font information

Chandu yadav

Chandu yadav

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

60 Views

Let’s say the following is our JTextArea −JTextArea textArea = new JTextArea("This is demo text.");Now, get the font using the Font class getFont() method as shown below −Font font = textArea.getFont(); System.out.println("Font = "+font);The following is an example to get JTextArea font information in Java −Examplepackage my; import java.awt.Font; import ... Read More

Permutation and Combination in Python?

Chandu yadav

Chandu yadav

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

971 Views

In this section, we are going to learn how to find permutation and combination of a given sequence using python programming language.One of the key advantage of python over other programming language is that it comes with huge set of libraries with it.We are going to use python inbuilt package ... Read More

How to create DefaultTableModel which is an implementation of TableModel

Chandu yadav

Chandu yadav

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

7K+ Views

Let us create DefaultTableModel −DefaultTableModel tableModel = new DefaultTableModel();Now, set the model to JTable −JTable table = new JTable(tableModel);Add a column −tableModel.addColumn("Languages");Now, we will add rows to our table −tableModel.insertRow(0, new Object[] { "CSS" }); tableModel.insertRow(0, new Object[] { "HTML5" });The following is an example to create DefaultTableModel −Examplepackage my; ... Read More

How to set border color for SoftBevelBorder in Java?

Chandu yadav

Chandu yadav

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

219 Views

To set the border color for SoftBevelBorder in Java, use the Color class and set the color while creating the border −SoftBevelBorder border = new SoftBevelBorder(    BevelBorder.RAISED, Color.ORANGE, Color.ORANGE.darker(), Color.BLUE, Color.magenta.brighter());We have set the following colors above as parameters −highlightOuterColor: color to use for the bevel outer highlight highlightInnerColor ... Read More

Write an equality in MongoDB without using $eq operator

Chandu yadav

Chandu yadav

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

66 Views

Let us first create a collection with documents -> db.operatorDemo.insertOne({"StudentSubject":["MongoDB", "MySQL", "Java"]}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cef94eaef71edecf6a1f6a2") } > db.operatorDemo.insertOne({"StudentSubject":["Java", "C", "C++"]}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cef94faef71edecf6a1f6a3") }Display all documents from a collection with the help of find() method -> db.operatorDemo.find().pretty();Output{   ... Read More

HTML Tag

Chandu yadav

Chandu yadav

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

17 Views

The element in HTML in HTML 4 was used to underlined a text on a web page, but HTML5 redefined to display text different from normal text.Let us now see an example to implement the tag−Example Live Demo Shortcut Keys Use the following shortcut keys: Cut: ... Read More

Mouse and keyboard automation using Python?

Chandu yadav

Chandu yadav

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

2K+ Views

In this section, we’ll try to automate the movements of mouse and keyboard using pyautogui module in python.Pyautogui is a library that allows you to control the mouse and keyboard to do various things.It  is a cross-platform GUI automation Python module for human beings.As it is a third party library, ... Read More

Set the JSlider vertical and move bottom-to-top in Java

Chandu yadav

Chandu yadav

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

84 Views

To set the JSlider vertical, use the VERTICAL constant while creating the slider. Let us create a new Slider −JSlider slider = new JSlider(JSlider.VERTICAL, 0, 100, 60);The other parameter values set above allows you to include the minimum, maximum and the initial value of the slider.The following is an example ... Read More

Advertisements