The compiler tells me that the variable after the while is not recognized.
What I especially don't understand is that the variable is defined and accepted in the character input and the swicth but later on is not recognized. I'm sure of this because I wrote the entire program, and then compiled it afterwards. I was therefore able to see the compiler advancing as the code was corrected
The error message is "cannot find symbol - variable choix"
On line 45 i am trying to add "-" symbol to my output phone number. As of now the out prints like "1800*45*3569377. I want it to print 1800-3569377, or even more ideal: 1-800-356-9377. When printing normally (system.out.println) I can print symbols, but when I try to print from a for-loop it says "unclosed character literal." import java.util.Scanner;
public class Phone_010473030 { public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Enter a phone number string: "); String Phone_num = input.nextLine(); Phone_num = Phone_num.toUpperCase();
// set up the generator CMSSignedDataGenerator gen = new CMSSignedDataGenerator(); gen.addSigner(key, cert, CMSSignedDataGenerator.DIGEST_SHA224); gen.addCertificatesAndCRLs(certsAndCRLs); addsigner and addCertificatesAndCRLs are not found in netbeans.
Which version of Bouncy Castle and JDK version this supports?
This code doesn't recognise the package ( and therefore class ) timetest3, when I try to import it. The package I try to reference/call, follows, and works fine.
import javax.swing.JOptionPane; import timetest3.TimeTest3; public class timetest4 { public static void main(String args[]) { TimeTest3 time = new TimeTest3(); time.setTime(13,45,52);
I am currently using notepad to create a Java program and using the command box to compile it and execute it and it has been working fine. I have the JDK version 7 so java.lang works which I know does not need to be imported. The Calendar method which should be recognized is not.
Here is the program. Cut this program and compile it in the command box. It will not recognize the Calendar method.
import java.util.*; class Practice4_2 { public static void main (String args[]) { Calendar cal = Calender.getInstance(); Date.now = new Date();
I wanted to create a simple window with the LWJGL and a key input request which closes the window.I also wanted to create the classes in seperated packages, so it's more organized.The window displays but if I press that certain key nothing happens.Here is the Main class:
package bb.main; import bb.input.Input; import bb.main.render.SimpleRenderer; public class Main { public static void main(String[] args){ SimpleRenderer createWindow = new SimpleRenderer(); Inputinput= new Input();
I have a program in which I am prompting users for integer values to display in a JFrame. I call the method below to load an array with their input:
Java Code:
public String inputAssembly(){ if (!jtfInput.getText().matches("d")){ JOptionPane.showMessageDialog(null, "Input must be of integer value."); } if (jrbFar.isSelected()){ return jtfInput.getText() + jrbFar.getText();
[Code] ....
Regardless of the input, both messages display (invalid input / got it). I've tried debugging so I know that the values are getting entered and read correct, at least to my knowledge. It is a very simple regular expression, only checking to be sure an integer was entered.
I've installed the Java JDK onto my Windows 8 laptop and the first thing I need to do is run the compiler from the Command Prompt. The first prompt I enter is C:java -version. This worked fine, however when I try to enter the next prompt C:javac -version, I am getting the following screen and messages:
Microsoft Windows [Version 6.3.9600] (c) 2013 Microsoft Corporation. All rights reserved.
C:UsersMary>java -version java version "1.8.0_20"
Java(TM) SE Runtime Environment (build 1.8.0_20-b26) Java HotSpot(TM) 64-Bit Server VM (build 25.20-b23, mixed mode)
C:UsersMary>javac -version 'javac' is not recognized as an internal or external command,
operable program or batch file.
I have entered the path into the environment variables area within my control panel. Not too sure why the first prompt works, but the second doesn't...
I think this might be the reason as this comboBox is not recognized at the import to the scene builder library. I can show up the import dialog of custom controls, but my custom ComboBox is not showing up. All other implementations are there correctly as they are loaded from my customControl.jar file
I use the ComboBoxListViewSkin for the functionality to scroll to an item in the combo as a user types a letter on the keyboard.
I do this by:
/** * This method scrolls the itemView of the items to the first item starting * with the given char or string * * @param pressedKey */ public void scrollToChar(String pressedKey) { String value = pressedKey.toUpperCase(); for (Object userEntry : getItems()) {
[Code] ....
I really need to show up my custom Combo in the scenebuilder, as otherwise the rest of my fxml is not editable in sceneBuilder 2.0 ....
I am writing a program in the GUI Builder and found that when I add code to print user input from text fields to a text file, the main method is no longer recognized. It throws all kinds of errors.
I have been able to get the code to work separately in a project file. Also, have been able to print to the console.
Exception in thread "main" java.lang.NullPointerException at javax.swing.ImageIcon.<init>(ImageIcon.java:205) at GUI.<init>(GUI.java:26) at Apples.main(Apples.java:7)
i think the problem is to do with my images not being recognised. I put them in my source in User>...>workspace>src which is correct as far as i know. From what i know the images should show up if i look at my src file in eclipse but they dont. I tried changing the file type from .png to .jpg but it makes no difference.
I am trying to print a loop inside an array of a greater size than the loop itself. Like for example I have an array of size 7 but it has only 3 elements.
now what I want to do is print these three numbers in a loop so that my array[3]=2;array[4]=3;array[5]=4 ...... till the last one. Also the array could be any size and not just 7.
Here's the code: it's while loop inside a for loop to determine the proper length of a variable:
for (int i = 0; i < num; i++) { horse[i]=new thoroughbred(); boolean propernamelength = false; while (propernamelength==false){ String name = entry.getUserInput("Enter the name of horse "
[code]....
I was just wondering what was going on here -- I've initialized the variable, so why do I get this message? (actually the carat was under the variable name inside the parentheses.
I have everything else working. My problem is that when i type "quit" to close the outer loop. It still runs the inner loop. The National Bank manager wants you to code a program that reads each clients charges to their Credit Card account and outputs the average charge per client and the overall average for the total number of clients in the Bank.
Hint: The OUTER LOOP in your program should allow the user the name of the client and end the program when the name entered is QUIT.In addition to the outer loop, you need AN INNER LOOP that will allow the user to input the clients charge to his/her account by entering one charge at a time and end inputting the charges whenever she/he enters -1 for a value. This INNER LOOP will performed the Add for all the charges entered for a client and count the number of charges entered.
After INNER LOOP ends, the program calculates an average for this student. The average is calculated by dividing the Total into the number of charges entered. The program prints the average charge for that client, adds the Total to a GrandTotal, assigns zero to the Total and counter variables before it loops back to get the grade for another client.Use DecimalFormat or NumberFormat to format the numeric output to dollar amounts.
The output of the program should something like this:
John Smith average $850.00 Maria Gonzalez average $90.67 Terry Lucas average $959.00 Mickey Mouse course average $6,050.89 National Bank client average $1,987.67
Code:
public static void main(String[] args) { Scanner scan = new Scanner(System.in); String name = ""; int charge = 0; int count = -1; int total = 1; int grandtotal = 0; int average = 0;
I am having trouble compiling my simple java program, i keep having this "cannot find symbol"Untitled.jpg but the ODD thing is when i tried to run my code through online java compiler like Ideone.com it compiles perfectly fine. "Check it here".is it because of my jdk? I use the latest jdk 8. and the book I'm following is "Head First Java"..here's my code
My assignment is to create an ObjectOutputStream object mapped to a binary output file named "ItemRecord_binary.txt". So far I've created a ItemRecord class with a constructor with getters and setters and a override toString method. It compiled. This ItemRecordReport class does not compile because of a can't find symbol error. Here is the code:
import java.io.*; import java.io.IOException; import java.io.ObjectOutputStream; import java.util.Scanner; public class ItemRecordReport { private ObjectOutputStream output;
I have written the below program and while compiling i am getting error. The program and error details goes as follows,
//compute distance of light travels using Java long variable. class Light { public static void main(String args[]) { int lightspeed; long days; long seconds; long distance;
[code]....
I have given the Java file name as 'Light.java'. I have also verified the availability of the java file and compilation path. both are matching. Also, Java file name and class name defined are also same.
I was given the Java code for a project and I am supposed to build unit tests to test the performance of seven sorting algorithms and I am getting the following error in my Lab1Test file...cannot find symbol: method sorta(int[]) location: class Lab1Test.
I keep getting errors, cannot find symbol. Not sure where I am going wrong.
java:139: error: non-static method integerPrompt(String,int,int) cannot be referenced from a static context int regNumber = integerPrompt("Enter registration number", 100, 5000); ^ Program7.java:145: error: cannot find symbol theSubject = integerPrompt(SubjectsPrompt, 1, SubjectQty); ^ symbol: variable theSubject location: class Program7
Java Code:
import java.util.*; import java.io.*; import java.util.Scanner; public class Program7{ public static void main(String args[]){ Student student = new Student();
When I put this code in throw new IllegalStateOperation("SortType is invalid"); it states that it can't find the symbol IllegalStateOperation. What should I do to initialize the symbol/variable IllegalStateOperation?
Here is the entire code: :
class HairSalon implements Comparable<HairSalon> { static final int sortByService = 0, sortByPrice = 1, sortByTime = 2; private String service; private double price; private int time;
I have the following code snipet and I get the following errors
interface expected here [javac] private class fileFilter implements FileNameExtensionFilter{ [javac] ^ cannot find symbol [javac] symbol : method fileFilter(java.lang.Object) [javac] location: class gui.components.StartupDialog