Im new to java and not too familiar with how to put the following text on 2 lines instead of one..... i know in C++ it was end. but how do you do it here?
JOptionPane.sho wMessageDialog( null, "Number of lower case e's: "+uppercaseCoun t(line)+" I WANT TO SKIP A LINE HERE Number of upper case e's: "+lowercaseCoun t(line)+""); } //end main
User Profile
Collapse
-
How to skip a line in code
-
import javax.swing.*;
public class Project0 {
public static void main (String args[]) {
String line = JOptionPane.sho wInputDialog("P lease enter a sentence.");
// Checks if input has minimum of 1 character //if (line.length() == 0) // System.exit(0);
if (line.length() !=0 || line.length() ==0 ){ // If input is 'Stop' (case sensitivite) // program will terminate. ... -
ahahah it doesnt run for some odd reason, im guessing i fuked up some of my curlies... but im trying to find out if i made some obvious errors... or made it harder for myself by using a long code, thanks thoughLeave a comment:
-
help on setting up letter counter with joptionpane dialog boxes
What I'm bad at is the dialog box part. This is the code Ive come up with... if you see a way to improve what im thinkng of.... post it please.
Program should....
1. Ask user to type in a sentence, using JOptionPane.sho wInputDialog().
2. The program will scan each letter in the string and count how many times the upper case letter 'E' appears, and how many times the lower case letter 'e' appears.
3. Using a JOptionPane.sho wInputDialog(),... -
How do i put together JOptionPane and letter counter to work?
I took a look at the site and found this as a counter. Is there any way I can use it in a dialog box, that asks user to input any number of letters in a (?)dialog box, pressing enter and out comes Number of upper/lower case e's in the (I)dialog box. Also have it repeat process until user enters Stop. Well yeah, thanks if anyone can help put that up tonight..
String str = "Count" ;
char ch =...
No activity results to display
Show More
Leave a comment: