Nishtha Thakur has Published 387 Articles

How to set the location of a button anywhere in JFrame?

Nishtha Thakur

Nishtha Thakur

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

6K+ Views

To set location of a button anywhere a JFrame, use the setBounds() method. Let us first create a frame and a panel −JFrame frame = new JFrame("Demo Frame"); JPanel panel = new JPanel(); frame.getContentPane();Create a component i.e. label and set the dimensions using setBounds(). Here, you can set the location ... Read More

How to create an Android notification without the icon in the status bar?

Nishtha Thakur

Nishtha Thakur

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

610 Views

This example demonstrate about How to create an Android notification without the icon in the status barStep 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details tocreate a new project.Step 2 − Add the following code to res/layout/activity_main.xml. ... Read More

How to create everyday notifications at certain time in Android?

Nishtha Thakur

Nishtha Thakur

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

2K+ Views

This example demonstrate about How to create everyday notifications at certain 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.     Step ... Read More

The Adaptive Tree Walk Protocol

Nishtha Thakur

Nishtha Thakur

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

9K+ Views

Adaptive Tree Walk Protocol is a technique for transmitting data over shared channels that combines the advantages of collision based protocols and collision free protocols.In computer networks, when more than one station tries to transmit simultaneously via a shared channel, the transmitted data is garbled, an event called collision. In ... Read More

How to retrieve a DATALINK object from a table using JDBC?

Nishtha Thakur

Nishtha Thakur

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

251 Views

A DATALINK object represents an URL value which refers to an external resource (outside the current database/data source), which can be a file, directory etc..You can retrieve a DATALINK object an SQL table using the getURL() method of the PreparedStatement interface. This method accepts an integer value representing an index ... Read More

How to use GridBagConstraints to layout two components in the same line with Java

Nishtha Thakur

Nishtha Thakur

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

363 Views

To align two components in the same line, you need to set the contrainsts of the GridBagConstraints properly. Let’s say we have two components in panel1. Set the contraints using Insets as well −panel1.add(checkBox1, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,    GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, ... Read More

The Hidden Terminal Problem

Nishtha Thakur

Nishtha Thakur

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

27K+ Views

In wireless LANs ( wireless local area networks), the hidden terminal problem is a transmission problem that arises when two or more stations who are out of range of each other transmit simultaneously to a common recipient. This is prevalent in decentralised systems where there aren’t any entity for controlling ... Read More

How to pop a single value in MongoDB?

Nishtha Thakur

Nishtha Thakur

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

265 Views

You can use pop() for this. Let us first create a collection with documents −> db.persistChangeDemo.insertOne({"Name" : "Larry", "CreditScore": [500, 700, 760, 100]}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cdfc52cbf3115999ed51203") }Following is the query to display all documents from a collection with the help of find() method −> ... Read More

How to lock & unlock the iOS device programmatically

Nishtha Thakur

Nishtha Thakur

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

714 Views

Locking of iOS device cannot be done programmatically without the use of Private API’s. One such private API’s GSEventLockDevice() (private API) from GraphicsServices.framework which might help you achieve your persona but the application would result in rejection from Apple’s App Store.More over there’s no documentation provided by apple for the ... Read More

How to use Notification.deleteIntent in Android?

Nishtha Thakur

Nishtha Thakur

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

802 Views

This example demonstrate about How to use Notification.deleteIntent 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.     Step 3 − Add ... Read More

Advertisements