Menu option Programming Software Development by inni2626 …07 int choice; 08 int Quit = 0; 09 String optionselected; 10 11 String outputString = " "; 12… 24 switch(choice ){ 25 26 27 case 1: optionselected = "Real Madrid"; 28 break; 29… Re: Menu option Programming Software Development by Taywin … you attempt to assign a string to an uninitialized variable 'optionselected'. Go back to line 9 and assign something to your… newly created String (i.e. String optionselected="";)... By the way, please read what the compiling… Re: Menu option Programming Software Development by inni2626 …args[])throws IOException{ int vote = 0; int Quit = 0; String optionSelected = " "; String outputString = " "; String…nInvalid input\nEnter Valid Vote 1 - 4 "); optionSelected = Integer.toString(x); System.out.println(x); … Re: Threads - need little help Programming Software Development by Alex Edwards …... args){ ConcurrentExample ce = new ConcurrentExample(); ce.optionSelected("http://www.google.com"); // invokes…wait 6 seconds before performing new task ce.optionSelected("http://www.msn.com"); // this…!\nPlease try again!"); } } public void optionSelected(String str){ // A new thread should only… Re: Threads - need little help Programming Software Development by Alex Edwards …... args){ ConcurrentExample ce = new ConcurrentExample(); ce.optionSelected("http://www.google.com"); // invokes …silently wait 6 seconds before performing new task ce.optionSelected("http://www.msn.com"); // this…!\nPlease try again!"); } } public void optionSelected(String str){ // A new thread should only … Re: Display an initial menu screen Programming Software Development by monarchmk … will be easier for you later to write code. String optionSelected = ""; // you do not need " " with space… if's?... You decalre array, use it optionSelected = Integer.toString(x); // This is same as optionSelected=input // REASON: because x = Integer.parseInt… Threads - need little help Programming Software Development by peter_budo …. Basically somewhere in my application I will call method [I]optionSelected(String)[/I]. The method will start first thread and is… next mp3 file and play it. [code=Java] public void optionSelected(String str) { t = new Thread("SEL"); t.start… Display an initial menu screen Programming Software Development by inni2626 …message, String menuOptions[]){ int choice; int Quit = 0; String optionSelected = " "; String outputString = " ";…;Invalid input\nEnter Valid Vote 1 - 4 "); optionSelected = Integer.toString(x); System.out.println(x); JOptionPane.… Re: Display an initial menu screen Programming Software Development by inni2626 …(String args[])throws IOException{ int choice; int Quit = 0; String optionSelected = " "; String outputString = " "; String…Invalid input\n Enter Valid Vote 1 - 4"); optionSelected = Integer.toString(x); System.out.println(x); JOptionPane.… Re: Display an initial menu screen Programming Software Development by monarchmk …args) { int choice; int quit = 0; String optionSelected = ""; String outputString = "";…("Invalid input\nEnter Valid Vote 1 - 4 "); optionSelected = input; System.out.println(x); JOptionPane.showMessageDialog(null, outputString… Re: Display an initial menu screen Programming Software Development by inni2626 …main(String args[]){ int choice; int quit = 0; String optionSelected = ""; String outputString = " ";…("Invalid input\nEnter Valid Vote 1 - 4 "); optionSelected = input; System.out.println(x); JOptionPane.showMessageDialog(null,outputString … Re: Display an initial menu screen Programming Software Development by inni2626 … static void main(String args[])throws Exception{ int choice; String optionSelected = ""; String outputString = " "; while (true) { choice=Integer… Re: Issue with Radio button selection Programming Web Development by rupeshpradhan ….php' method='post'> <input type='radio' name='optionSelected' value='1'>Option 1 <br> <…script_01.php [code=php] <?php @extract($_POST); print $optionSelected; ?> [/code] Now add the logic which will display … drop down boxed based on the return value of $optionSelected being 1 and 2 respectively. You could use if… Re: Java Menu GUI Programming Software Development by Justin_7 …; i++) { // Which options did they choose? if (optionSelected[i] == 0) { temp += 5; } if (optionSelected[i] == 1) { temp += 10; } } optionTotal = temp; // Display the… Re: Menu option Programming Software Development by Taywin It is right where the error is. You are using lower case 'l' (L) which is not correct. What you need is capital letter 'I' as Integer.parseInt(...). Re: Menu option Programming Software Development by inni2626 Yes i changed it' but now am getting this error [COLOR="Red"]Exception in thread "main" java.lang.ExceptionInInitializerError at ChampionLeague.main(ChampionLeague.java:30) Caused by: java.lang.RuntimeException: Uncompilable source code - modifier private,static not allowed here at lnterger.<clinit>(… Re: Menu option Programming Software Development by inni2626 I updated it and i don't get any error but it don't seem do display the result on the screen, rather it just prints the number of vote and shows the result on the keyboard display. [CODE] import javax.swing.JOptionPane; import java.io.*; public class ChampionLeague { public static void main(String args[])throws IOException{… Re: Menu option Programming Software Development by Taywin Of course, it does nothing. You didn't obtain the value reading from the user. Also, even you did that, your program will accept an input from a user only once and display the result. Your current score is 0 for your display (vote). You just take the value of the initial value of 'vote' to your 'x'. The showInputDialog() returns a string of the … Re: Menu option Programming Software Development by mKorbel and if you don't like if-else-if-else ...., then just for Integer instance: [CODE] switch (integer) { case 1: //some stuff case 2: //...... case 3: // ... case 4: //... default: System.out.println("someWarning"); }[/CODE] Re: Menu option Programming Software Development by Taywin The problem is your 'outputString' is not being assigned to anything. The reason I did not write anything inside the if-else statement because I wanted to see how much you understand the code. Anyway, it seems that you are still unclear about it. So the way to fix this is to append your outputString with those string you use in System.out.println… Re: Threads - need little help Programming Software Development by Alex Edwards I don't think it's the run method that isn't executing, Peter. I think the problem is that you are not submitting a Runnable target as the argument for the Thread to execute. I actually don't understand why the Thread class is not abstract if it allows one to simply give a Thread a title, but I will investigate this a bit more thoroughly and … Re: Threads - need little help Programming Software Development by Ezzaral Yes, the Threads in your example don't really do anything. You need to extend Thread and override run() or supply a Runnable to the constructor. Have you looked through the tutorial on concurrency as a starting point? [url]http://java.sun.com/docs/books/tutorial/essential/concurrency/runthread.html[/url] The java.util.concurrent package adds a lot… Re: Threads - need little help Programming Software Development by Ezzaral I'm curious, why you are wanting to use separate threads for what seems to be a synchronous process? You describe wanting to process another song after the current one is finished, but haven't mentioned anything that would require a concurrent process. Re: Threads - need little help Programming Software Development by Ezzaral Just to answer the question on waiting for one thread to finish before starting the next, here's a trivial example using the join() method[code=java] public class JoinExample { public static void main(String args[]) { Thread t1 = new Thread(new FirstTask()); Thread t2 = new Thread(new SecondTask()); t1.… Re: Threads - need little help Programming Software Development by peter_budo Thanx guys, I will play around with these examples. Already see few of the mistakes. Sorry that I can not provide more details as it is MSc project and I do not want to get my back side nailed for plagiarism (not now for sure) . Can you suggest some easy reading on concurrency (I like reading in style of Deitel or OReilly books, explanation with … Re: Threads - need little help Programming Software Development by stephen84s [QUOTE]Can you suggest some easy reading on concurrency (I like reading in style of Deitel or OReilly books, explanation with plenty of examples to try out)[/QUOTE] Well I don't know if this would be an overkill (especially if you just need to start up) but when it comes to concurrency, I liked Java Concurrency in Practice By Brian Goetz Re: Threads - need little help Programming Software Development by peter_budo OK guys, it is working! Current state of JSR-135: Mobile Media API still need lot of work. The main problem was I couldn't get PlayerListener working correctly to tell me when the song ends with (Player.END_OF_MEDIA) so I could supply another InputStream at that point to play. Therefore I started to play around with threads and come to ask for … Re: Threads - need little help Programming Software Development by Ezzaral [QUOTE=stephen84s;693020]Well I don't know if this would be an overkill (especially if you just need to start up) but when it comes to concurrency, I liked Java Concurrency in Practice By Brian Goetz[/QUOTE] Yes, [URL="http://www.briangoetz.com/"]Java Concurrency in Practice[/URL] would be my suggestion as well for thorough coverage of… Re: Display an initial menu screen Programming Software Development by Akill10 Have you even tried to compile this/test this before posting here? Re: Display an initial menu screen Programming Software Development by inni2626 [COLOR="Green"]Hi monarchmk, Sorry for the confusion and thanks for your comments.I wanted to display an initial menu screen with the following set of options: 1. Display the current score for each possible response. 2. Vote 3. Quit the program. Thats why i added [/COLOR] [COLOR="Red"]//Show menu and get users choice…