Creating a JLabel with Text Example

Below code creates a Simple JLabel with Text Example using JLabel() constructor method.Note that JLabel class has several methods.  

Output:

Read More


Check whether a JLabel is Enabled or Visible.

JLabel.setEnanbled() methods enable a JLabel or make it visible in it container.If you set false, the JLabel is not visible and if set truth, the JLabel is visible. Below code creates two JLabels, one is enabled and the other is not enabled.

Read More


How to overload java methods by changing data type

Below code shows how to overload java method by changing data type.See also Overloading java methods by changing the number of arguments.  

Output

Read More


Below Java program code takes two integers from the user, multiplies  them and display

Read More


Below java program code divided two numbers and prints the output on the screen.

Read More


Below java program code prints sum of two numbers and displays the result.

Read More


Below java program code is used to display “Hello World”  and print your name in a seperate line.

Read More


Below code shows how to connect to a MySQL database using com.mysql.jdbc.Driver.

Read More


Java JLabel setBorder () Method Example

Below code shows how to use Java JLabel setBorder ()  Method Example

OutPut: See also: Java JLabel getText and JTextField setText methods

Read More