Results 1 to 2 of 2
Thread: While loop for jpg
- 07-29-2010, 06:55 PM #1
Member
- Join Date
- Jul 2010
- Posts
- 1
- Rep Power
- 0
While loop for jpg
How am I able to run a while loop with JOptionPane.showInputDialog to open pictures and then crash when nothing is entered. I just started using java, so any help would be useful. This is what I have now.
static String show(String message, Object initValue) {
String reply = null;
if(initValue==null) reply=JOptionPane.showInputDialog(message);
else reply=JOptionPane.showInputDialog(message, initValue);
return reply;
}
public static void main(String[] args) {
String s;
s = show("Enter file name", null);
System.out.println(s);
while(s != ""){
System.out.println(s);
s = show("Enter file name", null);
}
}
}
- 07-29-2010, 08:25 PM #2
Similar Threads
-
How can I rewrite the following while loop using a for loop?
By gt11990 in forum New To JavaReplies: 5Last Post: 04-30-2010, 05:05 PM -
For Loop
By YiBoog in forum New To JavaReplies: 6Last Post: 11-11-2009, 07:53 PM -
Loop Help!
By Keno777 in forum New To JavaReplies: 3Last Post: 11-04-2009, 01:11 AM -
while-loop stopping on first loop
By davester in forum New To JavaReplies: 6Last Post: 06-26-2009, 08:46 PM -
While loop
By verbazon in forum New To JavaReplies: 5Last Post: 02-25-2009, 01:29 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks