2,777 Posted Topics
Re: Do you have any code? | |
Re: The representation of base 10 numbers in a double is not precise to the number of decimal places you are looking at. How close is 0.13122999999999999 to 0.13123? There are classes you can use if you need precision to more decimal places. | |
Re: [CODE]if (CurLine.equalsIgnoreCase("fifty")) { num = parseInt(CurLine); }[/CODE] What class is the parseInt method in? I've not seen a method that converts the name of a number("fifty") to an int. [CODE]int num = 0; if (num.equalsIgnoreCase(fifty)) {[/CODE] int's don't have methods. This shouldn't compile | |
Re: Can you post the full text of the error message? Does the A class have a getSomthing() method? | |
Re: [QUOTE] I'd just like to show both files in one. The files I'd like to add are commented out: [/QUOTE] Why are they commented out? What does the API doc for the addTab method say are valid arguments for it? | |
Re: What have you tried? Possible choices: USB, Wifi, a wire or cable | |
Re: Have you tried using the third constructor for the StringTokenizer class? [QUOTE]the blanks are being ignored [/QUOTE] Do you mean empty tokens? I think of a blank as being the same as a space character. Ie empty = "", space = " " | |
| |
Re: [QUOTE]I would like this code to call the path from the other class and then save the txt file[/QUOTE] Let me restate what you are trying to do. You have the path to the folder where you want to write the file in one place and the filename for the … | |
Re: Where do you want to save the scores? Do you have a server and a database? | |
Re: [QUOTE]it will not compile[/QUOTE] What was the error? | |
Re: Can you get the image in bytes in the same format and order as the bytes would be in a file on disk? If so, the ImageIO class could create an image from those bytes using an inputstream from a byte array. | |
Re: [QUOTE]is it possible to do that? vector * array??[/QUOTE] You'll have to write the code to do that. Unless you can find a third party package that does it. | |
Re: [QUOTE]it doesn't work. [/QUOTE] Probably 20 different ways to code it so it "doesn't work". Can you tell us which one you've used? Its probably the local variable problem. Move the definition of the array outside of the method. Copy and paste here the full text of any error messages. | |
Re: [QUOTE]having trouble working out how when the person is not found it throws the file not found exception.[/QUOTE] Have you looked at the File exists() method? | |
Re: What kind of programming experience do you have? This sounds like an advanced project. A question: How are you going to compute the coordinates of the bus on an image of a map to keep the bus on the route? A solution: create a special program to save the x,y … | |
Re: If this question is about javascript, you might try a javascript forum. This is a java forum. | |
Re: [QUOTE]what do I have to do to create that .jar if it originated on a disk drive and write it to a dir I have created on the hard drive[/QUOTE] Not sure I understand you question. If you create a jar in a directory, you can copy or move that … | |
Re: Have a time limit that you are willing to wait for the server. Have the test fail if the server doesn't respond in that time limit. That could return false values if the server does take longer than your limit. Use ping to test if the server exists. | |
Re: Do you get any error messages when you compile this code? Please copy and paste them here if you do. If there are no errors, show the output from the program and explain what is wrong with it and show what you want the output to be. | |
Re: Can you make a SMALL complete program that compiles and executes and demonstrates your problem? | |
Re: Define "better". For example, does NOT require any Microsoft components. | |
Re: [QUOTE]when I try to execute it it gives me an "exception in thread main java.lang.nosuchmethoderror main" [/QUOTE] How are you trying to execute the program? Can you show the command line and the error? Please copy the full text of the error message vs typing it in. | |
| |
Re: [QUOTE]throws a ClassCastException[/QUOTE] Please show full text of the error message. What type is ref1? The JVM says it is not a Sub2. Sub2 could have members not in Sub1. | |
Re: Please copy and paste here full text of the error message. Where is the images folder relative to the current directory when the program is executed? For debugging, Create the File object outside the ImageIO.read call and display its full path | |
Re: Create an instance of an object that implements ActionListener. Add that object as each button's action listener. To recognize which button, use the Event getSource() method. | |
Re: HTML Parser able to act like browser for sending POST requests from a <FORM | |
Re: Is this a problem that can only be solved in the ME enviroment? Or can you write the basic menu/list/windows using standard JDK classes and then convert to ME? There are more of us with the standard classes. | |
Re: [QUOTE]i want to check the string from starting index that it contains an integer[/QUOTE] Define what you mean by an integer? How many integers does: 12 + 3*5 -7 contain? I see 5: 12357 To test if a string contains an integer (define integer to be a digit char in … | |
Re: Get the value from the array into a String variable. Test if it is null and if so, set it to "No". Then pass that String to who ever wants the contents of the array at those index values. | |
Re: Need more info. What is in the manifest file? What is in the jar file? Use any utility that can open a zip file to view its contents. Open a command prompt window, change to the folder with the swingDemo.jar file and enter this command: java -jar swingDemo.jar Copy and … | |
Re: [QUOTE]the problem still exists though[/QUOTE] Can you describe what the problem is? When I run the code in AppleViewer, I get an blue oval vertically orientated in the lower left corner over the top of the image. | |
Re: [QUOTE]I am getting some format.double error [/QUOTE] Please copy here the full text of the error message. [CODE]System.out.printf( "The total pay is %d\n",pay);[/CODE] Read the API doc for the Formatter class to see how to write the formats for different data types. | |
Re: Do you have an algorithm for solving this problem? If you'll post that, we can help you write the java code to implement it. | |
Re: By columns I assume you mean two fields of data separated by some spaces on the same line. The line ending with a newline character. When you build the record insert the number of spaces between the two fields and add a newline char at the end: String rec = … | |
Re: [QUOTE]it won't allow me to[/QUOTE] DO you get an error message? Please post or explain what the problem is. [QUOTE] Am I missing another line error?[/QUOTE] What does that mean? | |
Re: 1) no easy way, May not be possible in the general case. 2) send each client the IP address of the other clients it wants to communicate with. The clients will need code to be able to act as servers for other clients to connect to them. 3) use a … | |
Re: [QUOTE] what really happens when I entered that line of code[/QUOTE] Please show the "line of code" you are referring to. [QUOTE]for something to happen[/QUOTE] What is the "something" that is to happen? Each executable statement does something or causes something to happen. | |
| |
Re: The code executes from the jar ok up to the point where it needs the class: com.microsoft.sqlserver.jdbc.SQLServerDriver Then because it can't find it, the program fails. You need to put the jar file with the missing class on the class path so the JVM can find the class. | |
Re: Turn the layout manager off by setting the layout manager to null. Then you can position components yourself. | |
Re: First thing: setVisible AFTER the GUI has been built. Another way to toggle a boolean is to set it to its ! value; showeng = !showeng; // toggle flag | |
Re: One comment: Make all of the hardcoded constants into finals with self documenting names: final static double InchesPerMeter = 39.37; | |
Re: [QUOTE]eed help with is making it so my graphics will redraw.[/QUOTE] Do you call repaint() after you have made changes that the paint method needs to have to draw the updated GUI? Add a println() in paint() to show the new values of x and y it is using. | |
Re: [QUOTE]to declare Int as a double[/QUOTE] double Int; // declare Int to be double Can you restate your question. I guess I don't understand what you are asking. Comment on your variable names: Don't use single letters for variables that hold data to be used later. Use a self-documenting name … | |
Re: [QUOTE]The problem is, suppose I select option 2 as the correct answer for first question, Then for second question option 2 appears as selected , [/QUOTE] What if you unselected all the answers before showing the next question? Can you post a small program that compiles and executes that demonstrates … | |
Re: Sorry, this looks like a javascript question on a java forum. Try a javascript forum. |
The End.