Daniol Thomas has Published 209 Articles

Calling external programs using SAP connector

Daniol Thomas

Daniol Thomas

Updated on 09-Dec-2019 06:46:49

178 Views

Yes, it is possible to address or call an external program using SAP connector SDK. From ABAP, you can reference external program by SAP’s RFC protocol.There are various SAP connector available for various programming languages. Few of them areJCo is the SAP Java connectorNCo is the .NET SAP connectorNW RFC ... Read More

What is the difference between == and === in JavaScript?

Daniol Thomas

Daniol Thomas

Updated on 18-Sep-2019 08:25:09

776 Views

Double equals (==) is abstract equality comparison operator, which transforms the operands to the same type before making the comparison. For example, 4    ==  4        // true '4'  ==  4        //true 4    == '4'       // true 0    == false ... Read More

Java Program to retrieve a Stream from a List

Daniol Thomas

Daniol Thomas

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

97 Views

Let us first create a List:List list = Arrays.asList(25, 50, 100, 200, 250, 300, 400, 500);Now, create a stream from the List:Stream stream = list.stream(); Arrays.toString(stream.toArray()));The following is an example to retrieve a Stream from a ListExampleimport java.util.Arrays; import java.util.List; import java.util.stream.Stream; public class Demo {    public static void ... Read More

Java Program to convert Stream to List

Daniol Thomas

Daniol Thomas

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

155 Views

Declare and initialize an Integer array:Integer[] arr = {50, 100, 150, 200, 300, 400, 500, 600, 700, 800, 1000};Now, create a stream with the above elements:Stream stream = Arrays.stream(arr);To convert the above stream to list, use Collectors.toList():stream.collect(Collectors.toList()The following is an example to convert Stream to List:Exampleimport java.util.Arrays; import java.util.stream.Collectors; import ... Read More

What happens when JDialog is set with Modality type MODELESS in Java

Daniol Thomas

Daniol Thomas

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

77 Views

Modeless dialog boxes are on the screen and are available for use. The following is an example to set JDialog with Modality type MODELESS:Exampleimport java.awt.Cursor; import java.awt.Dialog.ModalityType; import java.awt.Dimension; import java.awt.event.ActionEvent; import javax.swing.AbstractAction; import javax.swing.JButton; import javax.swing.JDialog; import javax.swing.JFrame; public class SwingDemo {    public static void main(String[] args) { ... Read More

How to transform List string to upper case in Java?

Daniol Thomas

Daniol Thomas

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

3K+ Views

Let’s first create a List string:List list = Arrays.asList("David", "Tom", "Ken", "Yuvraj", "Gayle");Now transform the above list to upper case:list.stream().map(players -> players.toUpperCase())To display, use forEach():list.stream().map(players -> players.toUpperCase()) .forEach(players -> System.out.print(players + ""));The following is an example to transform List string to upper case:Exampleimport java.util.Arrays; import java.util.List; public class Demo { ... Read More

How to leave space with EmptyBorder in Java Swing

Daniol Thomas

Daniol Thomas

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

403 Views

Llet us first create a JPanel and set titled border:JPanel panel = new JPanel(); panel.setBorder(BorderFactory.createTitledBorder("Demo Panel"));Now to create Empty Border:JPanel panel2 = new JPanel(new BorderLayout()); panel2.add(panel, BorderLayout.CENTER); panel2.setBorder(BorderFactory.createEmptyBorder(100, 100, 100, 100));The following is an example to leave space with EmptyBorder in Java Swing:Exampleimport java.awt.BorderLayout; import java.awt.Dimension; import javax.swing.BorderFactory; import javax.swing.JFrame; ... Read More

Java Program to use Soft Bevel Border in Swing

Daniol Thomas

Daniol Thomas

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

175 Views

Here, we are creating soft beven border on JComboBox:JComboBox comboBox = new JComboBox(list);Now, set bevel border:comboBox.setBorder(new SoftBevelBorder(BevelBorder.LOWERED));The following is an example to use soft bevel border in Swing:Exampleimport java.awt.Font; import java.awt.GridBagLayout; import javax.swing.JComboBox; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.border.BevelBorder; import javax.swing.border.SoftBevelBorder; public class SwingDemo {    static final String list[] ... Read More

What are the data types supported by JDBC?

Daniol Thomas

Daniol Thomas

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

187 Views

JDBC provides support for almost all the SQL datatypes Whenever the JDBC driver receives a call from a Java application it converts the Java datatypes in it to the corresponding SQL data types. The conversion process follows default mapping. Following is the list of data types supported by JDBC and ... Read More

The set() method of AbstractList class in Java

Daniol Thomas

Daniol Thomas

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

60 Views

The set() method of the AbstractList class is used to replace the element at the specified position in this list with the specified element. It returns the element that gets replaced.The syntax is as follows:public E set(int index, E ele)Here, the parameter index is the index of the element to ... Read More

Advertisements