Ankith Reddy has Published 996 Articles

How can I set scrollbars to never appear in Java?

Ankith Reddy

Ankith Reddy

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

115 Views

To set scrollbars to never appear, use the JScrollPane.HORIZONTAL_SCROLLBAR_NEVER and JScrollPane.VERTICAL_SCROLLBAR_NEVER. Let’s say you created a Box with some button components. Now, create a JScrollPane:JScrollPane scrollPane = new JScrollPane();Set the Viewport view as Box:scrollPane.setViewportView(box);Now, set the scrollbars to never appear:scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_NEVER);The following is an example to set scrollbars to never ... Read More

HTML width Attribute

Ankith Reddy

Ankith Reddy

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

174 Views

The width attribute of the element is used to set the width of the canvas in pixels. Following is the syntax −Above, pixels_val is the width set in pixels. Let us now see an example to implement the width attribute of the element −Example Live Demo ... Read More

How to limit text length of EditText in Android?

Ankith Reddy

Ankith Reddy

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

5K+ Views

This example demonstrate about How to limit text length of EditText 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.xml.     Step ... Read More

How to display a pdf document into an Android Webview?

Ankith Reddy

Ankith Reddy

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

2K+ 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 Android Phone Model programmatically?

Ankith Reddy

Ankith Reddy

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

2K+ Views

This example demonstrate about How to check Android Phone Model 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 get current foreground activity context in Android?

Ankith Reddy

Ankith Reddy

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

6K+ Views

This example demonstrate about How to get current foreground activity context 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 src/MyApp.javapackage app.tutorialspoint.com.sample ; import android.app.Activity ... Read More

How can I validate EditText input in Android?

Ankith Reddy

Ankith Reddy

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

1K+ Views

This example demonstrate about How can I validate EditText input 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

Find size of text stored in a specific MySQL column?

Ankith Reddy

Ankith Reddy

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

248 Views

You can use length() from MySQL to find the size of text stores in a specific column. Let us first create a tablemysql> create table DemoTable    (    CustomerName longtext    ); Query OK, 0 rows affected (0.67 sec)Insert records in the table using insert command −mysql> insert into ... Read More

How do I get the resource id of an image if I know its name in Android?

Ankith Reddy

Ankith Reddy

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

3K+ Views

This example demonstrate about How do I get the resource id of an image if I know its name 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 ... Read More

IF() function in a MySQL Select statement?

Ankith Reddy

Ankith Reddy

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

433 Views

The IF() function returns a value based on a condition.The syntax is as follows−SELECT IF(yourCondition, yourMessageIfConditionBecomesTrue, yourMessageIfConditionBecomesFalse) from yourTableName; Let us first create a table: mysql> create table DemoTable    (    Value int    ); Query OK, 0 rows affected (0.60 sec)Insert records in the table using insert command ... Read More

Advertisements