George John has Published 1080 Articles

Customize the tooltip font, color , background and foreground color in Java

George John

George John

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

2K+ Views

To customize the tooltip font, color and background, use UIManager.UIManager.put("ToolTip.background", Color.ORANGE); UIManager.put("ToolTip.foreground", Color.BLACK); UIManager.put("ToolTip.font", new Font("Arial", Font.BOLD, 14));Above, we have set the font with −Tooltip.fontWe have set the foreground and background color with the following above −ToolTip.foreground ToolTip.backgroundThe following is an example to customize tooltip −Examplepackage my; import java.awt.Color; import ... Read More

Get the size of a collection in MongoDB using conditions?

George John

George John

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

221 Views

Let us first create a collection with documents −> dbmongoDBCollectionSizeDemoinsertOne({"Name":"John", "Age":23}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cf23e3db64a577be5a2bc16") } > dbmongoDBCollectionSizeDemoinsertOne({"Name":"Chris", "Age":24}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cf23e45b64a577be5a2bc17") } > dbmongoDBCollectionSizeDemoinsertOne({"Name":"Robert", "Age":26}); {    "acknowledged" : true,    "insertedId" : ObjectId("5cf23e4db64a577be5a2bc18") }Following is the query ... Read More

HTML

George John

George John

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

183 Views

The type attribute of the element is used to set type of the button. Following is the syntax −Above, we have shown the different types set for the button element i.e.: submit −button: A clickable buttonsubmit: Submit button (submits form-data)reset: It is a reset button to reset it to the ... Read More

How to create a custom navigation drawer in Android?

George John

George John

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

5K+ Views

This example demonstrate about How to resize Image in Android App.Step 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

How to make a phone call using intent in Android?

George John

George John

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

997 Views

This example demonstrate about How to lock the Android device programmatically.Step 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 − ... Read More

How to detect click on HTML button through javascript in Android WebView?

George John

George John

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

4K+ Views

This example demonstrate about How to lock the Android device programmatically.Step 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 − ... Read More

How to check if Location Services are enabled in Android App?

George John

George John

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

2K+ Views

This example demonstrate about How to check if Location Services are enabled in Android App.Step 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.java   ... Read More

Is there a MAX function for rows and not for columns in MySQL?

George John

George John

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

168 Views

Yes, you can use GREATEST() from MySQL to check maximum from rows (not columns). Let us first create a table −mysql> create table DemoTable    (    Value1 int,    Value2 int,    Value3 int    ); Query OK, 0 rows affected (0.58 sec)Insert records in the table using insert ... Read More

How to add manifest permission to an application in Android?

George John

George John

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

669 Views

This example demonstrate about How to add manifest permission to an application in Android.Step 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.java Step 3 − ... Read More

I want to return the next node after this node in a JTree with Java

George John

George John

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

244 Views

Use the getNextNode() method to get the next node after this node in Java. Here, we are displaying the next node of child node “eight” -System.out.println("Next node after this node = "+eight.getNextNode());The following is an example to return the next node after this node in a JTree -Examplepackage my; import ... Read More

Advertisements