How to check if a string contains a digit and return true in Java

String class in java represent character strings .Just like other constants Strings values cannot be changed.String objects  can be shared and they are immutable.Example of a  string in java String str=”Eric loves programming”. Today we are going to use different String class methods to write a method that returns true if a string contains a […]

Read More


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