2,777 Posted Topics

Member Avatar for muniba
Member Avatar for kiranpvsr

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.

Member Avatar for NormR1
0
134
Member Avatar for Mylsamy

[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

Member Avatar for javaAddict
0
136
Member Avatar for NT.

Can you post the full text of the error message? Does the A class have a getSomthing() method?

Member Avatar for JamesCherrill
0
90
Member Avatar for abbyo

[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?

Member Avatar for NormR1
0
127
Member Avatar for selfrules
Member Avatar for NormR1
0
119
Member Avatar for agen8k
Member Avatar for Member 784374

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 = " "

Member Avatar for Member 784374
0
69
Member Avatar for Temmu
Member Avatar for cac186

[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 …

Member Avatar for cac186
0
611
Member Avatar for Hawkpath
Member Avatar for NormR1
0
449
Member Avatar for jemz
Member Avatar for mani_1991

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.

Member Avatar for javaAddict
0
265
Member Avatar for hazeeel

[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.

Member Avatar for hazeeel
0
110
Member Avatar for Sunshineserene

[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.

Member Avatar for NormR1
0
239
Member Avatar for browgreg

[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?

Member Avatar for NormR1
0
137
Member Avatar for new_divine

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 …

Member Avatar for jon.kiparsky
0
337
Member Avatar for rogue005
Member Avatar for jamesyrawr

If this question is about javascript, you might try a javascript forum. This is a java forum.

Member Avatar for peter_budo
0
99
Member Avatar for ceyezumma

[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 …

Member Avatar for NormR1
0
106
Member Avatar for Cort3z

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.

Member Avatar for Cort3z
0
113
Member Avatar for Xufyan

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.

Member Avatar for yasuodancez
0
1K
Member Avatar for tizon

Can you make a SMALL complete program that compiles and executes and demonstrates your problem?

Member Avatar for tizon
0
1K
Member Avatar for extemer
Member Avatar for soundman107

[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.

Member Avatar for NormR1
0
111
Member Avatar for blueman:-0
Member Avatar for aditya027

[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.

Member Avatar for aditya027
0
113
Member Avatar for jiraiya

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

Member Avatar for jiraiya
0
2K
Member Avatar for surk23

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.

Member Avatar for tong1
0
1K
Member Avatar for Anand111

HTML Parser able to act like browser for sending POST requests from a <FORM

Member Avatar for jon.kiparsky
-1
57
Member Avatar for emmas4impact

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.

Member Avatar for emmas4impact
0
223
Member Avatar for mayursharma

[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 …

Member Avatar for jon.kiparsky
0
173
Member Avatar for Xufyan

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.

Member Avatar for Xufyan
0
143
Member Avatar for mayank.dyl

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 …

Member Avatar for NormR1
0
118
Member Avatar for runee1000

[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.

Member Avatar for MTSranger
0
104
Member Avatar for capsitan

[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.

Member Avatar for NormR1
0
159
Member Avatar for suguna07

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.

Member Avatar for Xufyan
0
68
Member Avatar for gor.irina

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 = …

Member Avatar for java_programmer
0
137
Member Avatar for Mirage'

[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?

Member Avatar for Mirage'
0
234
Member Avatar for sitajaf

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 …

Member Avatar for NormR1
0
109
Member Avatar for spadusca

[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.

Member Avatar for JamesCherrill
0
150
Member Avatar for wwefriend
Member Avatar for NormR1
0
65
Member Avatar for elmoualh

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.

Member Avatar for elmoualh
0
230
Member Avatar for gauravk_bhanot

Turn the layout manager off by setting the layout manager to null. Then you can position components yourself.

Member Avatar for gauravk_bhanot
0
3K
Member Avatar for nocookies92

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

Member Avatar for new_programmer
0
2K
Member Avatar for dylgod

One comment: Make all of the hardcoded constants into finals with self documenting names: final static double InchesPerMeter = 39.37;

Member Avatar for jon.kiparsky
0
121
Member Avatar for Fedhell

[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.

Member Avatar for Fedhell
0
713
Member Avatar for fr0styh3rb

[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 …

Member Avatar for NormR1
0
185
Member Avatar for har58

[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 …

Member Avatar for NormR1
0
122
Member Avatar for JimBoCol

Sorry, this looks like a javascript question on a java forum. Try a javascript forum.

Member Avatar for JimBoCol
0
140

The End.