Nishtha Thakur has Published 498 Articles

How to set Row Header View for JScrollPane in Java?

Nishtha Thakur

Nishtha Thakur

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

690 Views

Set Row Header View using the setRowHeaderView() method. Let us first create a KScrollPane and set a list −List myList = new ArrayList(10); for (int index = 0; index < 20; index++) {    myList.add("List Item " + index); } final JList list = new JList(myList.toArray(new String[myList.size()])); JScrollPane scrollPane = ... Read More

Are there benefits of passing by pointer over passing by reference in C++?

Nishtha Thakur

Nishtha Thakur

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

512 Views

A pointer can receive a null parameter whereas a reference can’t. You can only use pointer if you want to pass “no object”.Explicitly passing by pointer allow us to see the whether the object is passes by reference or value at call site.These are simple example of passing by pointer ... Read More

How to remove the notification after the particular time in android?

Nishtha Thakur

Nishtha Thakur

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

754 Views

This example demonstrate about How to remove the notification after the particular time in androidStep 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.   ... Read More

C++ Program to Decode a Message Encoded Using Playfair Cipher

Nishtha Thakur

Nishtha Thakur

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

483 Views

In this scheme, pairs of letters are encrypted, instead of single letters as in the case of simple substitution cipher.In playfair cipher, initially a key table is created. The key table is a 5×5 grid of alphabets that acts as the key for encrypting the plaintext. Each of the 25 ... Read More

Update multiple rows in a single MongoDB query?

Nishtha Thakur

Nishtha Thakur

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

409 Views

Use the concept of initializeUnorderedBulkOp(). Let us first create a collection with documents −>db.upDateMultipleRowsDemo.insertOne({"CustomerName":"John", "CustomerPurchaseAmount":500}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cd6ceb06d78f205348bc626") } >db.upDateMultipleRowsDemo.insertOne({"CustomerName":"Chris", "CustomerPurchaseAmount":700}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cd6ceb26d78f205348bc627") } >db.upDateMultipleRowsDemo.insertOne({"CustomerName":"David", "CustomerPurchaseAmount":50}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cd6ceb36d78f205348bc628") } >db.upDateMultipleRowsDemo.insertOne({"CustomerName":"Larry", ... Read More

How to detect a new Android notification?

Nishtha Thakur

Nishtha Thakur

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

3K+ Views

This example demonstrate about How to detect a new Android notificationStep 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to src/MyListener.javapublic interface MyListener {    void setValue (String ... Read More

Set the alignment of the JLabel content along the X axis on the right in Java

Nishtha Thakur

Nishtha Thakur

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

215 Views

To set the alignment of the label’s content along the X axis on the right, use the setHorizontalAlignment() method and set the location. Let us first set a label component. We have set the label background color as well so that we can check the alignment of the label’s content ... Read More

C++ Program to Implement the Vigenere Cypher

Nishtha Thakur

Nishtha Thakur

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

8K+ Views

Vigenere Cipher is a kind of polyalphabetic substitution method of encrypting alphabetic text.Vigenere Cipher Table is used in which alphabets from A to Z are written in 26 rows, for encryption and decryption in this method.EncryptionKey: WELCOMEMessage: ThisistutorialspointHere we have to obtain a key by repeating the given key till ... Read More

C++ Program to Find the Longest Subsequence Common to All Sequences in a Set of Sequences

Nishtha Thakur

Nishtha Thakur

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

203 Views

Here we shall discuss a C++ program to find the Longest Subsequence Common to All Sequences in a Set of Sequences.AlgorithmsBegin Take the array of strings as input. function matchedPrefixtill(): find the matched prefix between string s1 and s2 :    n1 = store length of string s1.    n2 ... Read More

How to set the text of the JLabel to be right-justified and vertically centered in Java?

Nishtha Thakur

Nishtha Thakur

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

862 Views

To set the text of the label component to be right- justified and vertically centered, you need to set the alignment while creating a new label.Set the label to be on the right -JLabel label = new JLabel("Name", JLabel.RIGHT);Here, we have set the size of the label as well as ... Read More

Advertisements