Smita Kapse has Published 498 Articles

Java program to place component in bottom-right corner with BorderLayout

Smita Kapse

Smita Kapse

Updated on 19-Sep-2024 21:57:30

1K+ Views

In this article, we will learn how to place a component, specifically a button, in the bottom-right corner of a Java Swing application using the BorderLayout manager. The BorderLayout is one of the most commonly used layout managers in Java, and it allows you to place components in five different ... Read More

Java program to set horizontal alignment of content in a JTextField

Smita Kapse

Smita Kapse

Updated on 29-Aug-2024 15:54:48

3K+ Views

In this article, we will learn how to set the horizontal alignment of content in a JTextField class using Java Swing. The content in the JTextFile is by default left aligned, but you can change it using the setHorizontalAlignment() method. Steps to Set Horizontal Alignment of Content in a JTextField ... Read More

Java program to center a JLabel in a JPanel with LayoutManager

Smita Kapse

Smita Kapse

Updated on 06-Aug-2024 22:40:41

4K+ Views

In this article, we will create a graphical user interface (GUI) using the Swing. The Swing is the GUI framework for Java-based applications Here, we are using the LayoutManager GridBagLayout to center the components of AWT Layouts. We have two components here including a label and we have set the layout ... Read More

How to Write/create a JSON array using Java?

Smita Kapse

Smita Kapse

Updated on 06-Sep-2023 21:23:55

49K+ Views

A JSON array is an ordered collection of values that are enclosed in square brackets i.e., it begins with '[' and ends with ']'. The values in the arrays are separated by ', ' (comma).Sample JSON array{    "books": [ Java, JavaFX, Hbase, Cassandra, WebGL, JOGL] }The JSON-simple is a ... Read More

How to position text to top left position on an image with CSS

Smita Kapse

Smita Kapse

Updated on 04-Jul-2020 06:16:38

1K+ Views

To position text to top left, use the left and top property. You can try to run the following code to position text to left position on an image −ExampleLive Demo                    .box {             position: ... Read More

Modify the behavior of the flex-wrap property with CSS

Smita Kapse

Smita Kapse

Updated on 03-Jul-2020 10:35:13

243 Views

Use the align-content property to modify the behavior of the flex-wrap property.ExampleYou can try to run the following code to implement the flex-wrap property −Live Demo                    .mycontainer {             display: flex;       ... Read More

Role of CSS flex-wrap property wrap-reverse value

Smita Kapse

Smita Kapse

Updated on 03-Jul-2020 07:36:20

181 Views

Use the flex-wrap property with wrap-reverse value to wrap flex-items in reverse order.ExampleYou can try to run the following code to implement the wrap-reverse value −Live Demo                    .mycontainer {             display: flex;     ... Read More

Which characters are NOT allowed in MongoDB field names?

Smita Kapse

Smita Kapse

Updated on 29-Jun-2020 16:00:38

788 Views

Do not use $ symbol or period (.) because these characters are not allowed for MongoDB field names. The field shouldn’t start with $.Here is an example of the allowed characters −> db.charactersAllowedDemo.insertOne({"Employee Name" : "John"}); {    "acknowledged" : true,    "insertedId" : ObjectId("5c7fefbc8d10a061296a3c6d") }Display all documents from a ... Read More

How to use multiple threads in android?

Smita Kapse

Smita Kapse

Updated on 29-Jun-2020 14:57:05

3K+ Views

Before getting into an example, we should know what thread is. A thread is a lightweight sub-process, it going to do background operations without interrupt to ui. This example demonstrate about How to use multiple threads in android.Step 1 − Create a new project in Android Studio, go to File ... Read More

How to avoid thread start twice in android?

Smita Kapse

Smita Kapse

Updated on 29-Jun-2020 14:36:41

516 Views

Before getting into an example, we should know what thread is. A thread is a lightweight sub-process, it going to do background operations without interrupt to ui. This example demonstrate about How to avoid thread start twice in android.Step 1 − Create a new project in Android Studio, go to ... Read More

Advertisements