Question: The first function is to write code using the Java language that does the following: The user enters some text in his dialog box, and
The first function is to write code using the Java language that does the following: The user enters some text in his dialog box, and it gives the result the number of small characters in the entered text and displays it in a dialog box as well.
it's mean like the word( Khalid ) there is 4 small letters and one capital letters only print it not count it
in short our proffessor want a program that's only Count the small letters in any words and the capital letters in this word print it like (K) from khalid and (4) for the small letters and thank you

this is my code I hope you understand me
package jtextbox; import javax.swing.*; import java.awt.event. *; public class JJ { public static void main(String] args) { JFrame f = new JFrame ("hi !"); JButton b = new JButton("press"); JTextField tf = new JTextField(); JTextField tf1 = new JTextField(); b.setBounds(125, 210, 100, 50); tf.setBounds(25, 100, 100, 25); tf1.setBounds(225, 100, 100, 25); f.setSize(400, 400); f.add(b); f.add(tf); f.add(tf1); f.setLayout(null); f.setVisible(true); f.setIconlmage(null); b.addActionListener((ActionEvent e )->{ String str1 = tf.getText(); int LowerCase = 0; for(int i=0;i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
