Chandu yadav has Published 1091 Articles

HTML Tag

Chandu yadav

Chandu yadav

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

70 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

115 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

MongoDB query to get last inserted document?

Chandu yadav

Chandu yadav

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

14K+ Views

To get last inserted document, use sort() along with limit(1).Let us first create a collection with documents −> db.getLastInsertedDocument.insertOne({"Name":"John"}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cefb17eef71edecf6a1f6a8") } > db.getLastInsertedDocument.insertOne({"Name":"Chris"}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cefb181ef71edecf6a1f6a9") } > db.getLastInsertedDocument.insertOne({"Name":"Robert"}); {    "acknowledged" : true,    "insertedId" ... Read More

Get the total number of leaves of a JTree in Java?

Chandu yadav

Chandu yadav

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

183 Views

To get the total number of leaved of a JTree, apply the getLeafCount() method on the root node. Let’s say our root node is “node”, therefore to count the number of leaves, use −node.getLeafCount()The following is an example to get the total number of leaves of a JTree −package my; ... Read More

Short Circuiting Techniques in Python?

Chandu yadav

Chandu yadav

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

2K+ Views

A common mistake for people new to programming is a misunderstanding of the way that boolean operators works, which stems from the way the python interpreter reads these expressions. For example, after initially learning about "and " and "or" statements, one might assume that the expression X = (‘x’ or ... Read More

How to create a Matte-look border using a solid color in Java?

Chandu yadav

Chandu yadav

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

162 Views

The matte border gives a “matte” look. Let’s say the following is our component −JLabel label; label = new JLabel("This has matte border!");Let us create a matte border with BorderFactory class. Here, we have given color YELLOW using the Color class −label.setBorder(BorderFactory.createMatteBorder(3, 5, 10, 5, Color.YELLOW));The following is an example ... Read More

HTML
target Attribute

Chandu yadav

Chandu yadav

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

367 Views

The target attribute of the element allows you to display the response generated after submitting the form.Following is the syntax −Here, _blank is used to display the response in new window or tab, _self display the response in the same frame, _parent displays the response in the parent frame, ... Read More

Is it possible to return a list of specific values from a MongoDB query?

Chandu yadav

Chandu yadav

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

180 Views

Yes, using map(). Let us first create a collection with documents −> dblistOfSpecificValuesDemoinsertOne({"StudentName":"John"}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cefcc8fef71edecf6a1f6bb") } > dblistOfSpecificValuesDemoinsertOne({"StudentName":"Chris"}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cefcc94ef71edecf6a1f6bc") } > dblistOfSpecificValuesDemoinsertOne({"StudentName":"Robert"}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cefcc98ef71edecf6a1f6bd") } > dblistOfSpecificValuesDemoinsertOne({"StudentName":"David"}); { ... Read More

How to set Palette Layer for JDesktopPane in Java?

Chandu yadav

Chandu yadav

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

215 Views

At first, create a JDesktopPane −JDesktopPane desktopPane = new JDesktopPane();Now, create an Internal Frame −JInternalFrame intFrame = new JInternalFrame("Our Frame", true, true, true, true); intFrame.setBounds(50, 90, 200, 250);Set Pallette layer for JDesktopPane and add the Internal Frame to JDesktopPane −intFrame.putClientProperty("JInternalFrame.isPalette", Boolean.TRUE); desktopPane.add(intFrame, JDesktopPane.PALETTE_LAYER);The following is an example to set palette ... Read More

Advertisements