Nishtha Thakur has Published 495 Articles

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

345 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

26K+ 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

Working with Xcode Auto Layout in Swift and iOS

Nishtha Thakur

Nishtha Thakur

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

3K+ Views

Auto layout is constraint based layout system used for development of User Interfaces for iOS Devices. This layout based constraint system also known as Auto Layout is basically an adaptive UI which adapts to screens of different sizes and orientations.Auto layout is completely dependent on constraints where developer defines a ... Read More

How to pop a single value in MongoDB?

Nishtha Thakur

Nishtha Thakur

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

255 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

695 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

776 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

Why I am facing a problem using the field 'from' in SQL query?

Nishtha Thakur

Nishtha Thakur

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

123 Views

You cannot use from as a column name directly because from is a reserved word in MySQL. To avoid this, you need to use backtick symbol. Let us first create a table −mysql> create table DemoTable    (    Id int NOT NULL AUTO_INCREMENT PRIMARY KEY,    `from` varchar(100),   ... Read More

How to insert Binary data into a table using JDBC?

Nishtha Thakur

Nishtha Thakur

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

2K+ Views

SQL databases provide a datatype named Blob (Binary Large Object) in this, you can store large binary data like images.To store binary (stream) values into a table JDBC provides a method called setBinaryStream() in the PreparedStatement interface.It accepts an integer representing the index of the bind variable representing the column ... Read More

Set whether the cell in the table model can be selected or deselected in Java?

Nishtha Thakur

Nishtha Thakur

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

100 Views

We can set or disallow selection of cell in the table using setCellSelectionEnabled(). The following is an example. −If you want to allow selection of cell, then set the method to TRUE −table.setCellSelectionEnabled(true);If you want to disallow selection of cell, then set the method to FALSE −table.setCellSelectionEnabled(false);Here we have disallowed ... Read More

Find minimum value with MongoDB?

Nishtha Thakur

Nishtha Thakur

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

371 Views

To get the minimum value, use sort() along with limit(1). Let us first create a collection with documents −> db.findMinimumValueDemo.insertOne({"Value":1004}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cdfd61abf3115999ed51208") } > db.findMinimumValueDemo.insertOne({"Value":983}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cdfd61ebf3115999ed51209") } > db.findMinimumValueDemo.insertOne({"Value":990}); {    "acknowledged" : true,   ... Read More

Advertisements