2,777 Posted Topics

Member Avatar for 03hasnam

Is "cast" the right word to use here? Would the more generic term: convert be better? I think of cast as a coding technique: a datatype in parenthesis () before an expression.

Member Avatar for JamesCherrill
0
463
Member Avatar for apapap
Member Avatar for irock_4you

What questions do you have about writing this code? Do you have problems, please post them.

Member Avatar for v3ga
0
121
Member Avatar for gourav1

One exception to the holding of a lock when in a synchronized block is if the code calls the wait() method. It then releases the lock.

Member Avatar for NormR1
0
161
Member Avatar for 03hasnam

[QUOTE]hard to extract the entrance time from the file [/QUOTE] Are you gettting compiler errors? Please post the errors or please explain what the problem is. Where is the enterListener() method? I see this: enterButton.addActionListener(new enterListener()); which looks like enterListener is a class and not a method. You don't use …

Member Avatar for 03hasnam
0
174
Member Avatar for creative_m

[QUOTE]I want to store variables in a text file (not as an object)[/QUOTE] Can you explain what you want to do? Text files usually contain Strings. If you want to write values of some String variables to a file that should be no problem. You won't be able to write …

Member Avatar for creative_m
0
122
Member Avatar for gourav1

[QUOTE] why not start method starts executing rather than going back to main class(A here)?[/QUOTE] When you call start() for a Thread you tell the OS to put the referenced thread in the queue of threads that it maintains. When the OS decides, it will chose one of the threads …

Member Avatar for ~s.o.s~
0
329
Member Avatar for n3red
Member Avatar for hfx642
0
1K
Member Avatar for desert564

Is Your problem: Finding the correct algorithm? Or is it writing a correct program to follow your algorithm? Can you explain the algorithm you are trying to program? What are the steps you need to take to solve the problem?

Member Avatar for NormR1
0
186
Member Avatar for vijay4

[CODE] super.paint(g);[/CODE] That may be clearing the old drawings. Remove it to see what happens. Removing is not the solution as you will see. You need to have a way to "remember" what was drawn previously so you can draw it again. You could put all the values in a …

Member Avatar for NormR1
0
160
Member Avatar for deanus

[QUOTE]printing to the screen etc) while waiting for input.[/QUOTE] Could that result in output and input being mixed together?

Member Avatar for JamesCherrill
0
86
Member Avatar for infinitus

[QUOTE]bunch of unknown to me errors are coming up.[/QUOTE] Please copy and paste here the full text of your error messages. Why so many inner classes named frame? When using the BorderLayout only ONE component can be placed in each location. You are placing more than one in them. If …

Member Avatar for infinitus
0
256
Member Avatar for George91340

Which line in you source is the error on? I don't see the line you mentioned: list.add(); All the calls to add() have arguments, none are empty like you say the error is about???

Member Avatar for NormR1
0
187
Member Avatar for mrjeck2008

Another way to find your desired lines in the file is to use a String method to see if the line has the String in it you are looking for. The String class also has methods for getting at the substrings that are delimited by your marker character(:)

Member Avatar for NormR1
0
584
Member Avatar for msmorsan

[QUOTE]NoClassDefFoundError: AconsultaMysql (wrong name: webconsultas/AconsultaMysql)[/QUOTE] Is your class in a package? If so you need to include the package name in the code= tag: code="webconsultas.AconsultaMysql"

Member Avatar for NormR1
0
325
Member Avatar for chinee

[QUOTE] the only error i am getting [/QUOTE] Please post the full text of the error messages and your questions.

Member Avatar for NormR1
0
341
Member Avatar for riahc3

[QUOTE]How do I do this in Java giving the same output as the C++ program? [/QUOTE] Can you look at the file the C++ program generates with a hex editor? If the contents of the file are the bytes for an int variable, a java program can write out the …

Member Avatar for riahc3
0
939
Member Avatar for F1r3st0rm

I don't know if you can have two classes using the same InputStream object. I've never tried it so it could work. How would the two different classes not get in each others way? What if one class reads a full buffer of data, but only processes part of it. …

Member Avatar for F1r3st0rm
0
1K
Member Avatar for angeriel1

[QUOTE]when you reach the last employee in record the Next and previous buttons should be disabled[/QUOTE] Do you know how to detect when the last employee record has been reached? Do you know how to disable a button? Read the API doc for the button class for a method to …

Member Avatar for hfx642
0
731
Member Avatar for dsoto

[QUOTE]I am having trouble with this last part[/QUOTE] Please explain what your problem is. If you are getting errors, copy and paste the full text of the error message here. What is that last piece of code you posted supposed to be doing?

Member Avatar for NormR1
0
1K
Member Avatar for udayashan
Member Avatar for SketchGamer

[QUOTE] why it formatted weird.[/QUOTE] Could be your tabs are set differently than the forums. Can change your tabs to spaces? [QUOTE] I don't know how to (take the sum) or how to search through the arrays to check the values.[/QUOTE] Write a simple program that works with a loop …

Member Avatar for zeroliken
0
1K
Member Avatar for aldeene

[QUOTE]stop the execution of codes on error[/QUOTE] It works the opposite way. A catch can allow the program to continue executing when there is an error. Go to this site and read up: [url]http://docs.oracle.com/javase/tutorial/essential/exceptions/index.html[/url]

Member Avatar for stultuske
0
157
Member Avatar for lbgladson

[QUOTE]What do I need to do to make it work to display like the picture above?[/QUOTE] Look at what your code does for each statement it executes. Play computer by tracking thru the logic using a piece of paper and a pencil writing down the values of the variables as …

Member Avatar for stultuske
0
452
Member Avatar for Daigan

[QUOTE]ArrayIndexOutOfBoundsException?[/QUOTE] Your index is out of bounds. Print out the length of the array where you are having the problem and compare its size with the index value shown in the error message. Remember arrays are zero based. The max index is the length - 1

Member Avatar for Daigan
0
237
Member Avatar for jmercer23

Check the pairing of the {}s in your code. Also the code is not indented according to standards. Code nested within {} should be indented 3-4 spaces for each level of nesting of {}

Member Avatar for NormR1
0
496
Member Avatar for sirlink99
Member Avatar for tleverington1

Can you ask specific questions about your program? Are you asking how to make a loop that indexes through an array and calls methods for the objects that are elements in the array?

Member Avatar for tleverington1
0
2K
Member Avatar for JavaPrograms

[QUOTE]I'm not sure to as why it wouldn't work[/QUOTE] Are you getting errors? If so please post the full text of the messages. Is the program output incorrect, if so please post the program's output, eplain what is wrong with it and show what the output should be.

Member Avatar for bibiki
0
485
Member Avatar for CollegeBeginner

[QUOTE]I'm having problems with[/QUOTE] Please take the methods one at a time and explain what your problem is with it. Describe in detail what the method is supposed to do and explain your problems writing the code to do that.

Member Avatar for CollegeBeginner
0
989
Member Avatar for IcantC

Look at the Integer class. It has methods to convert int values to different Strings for displaying.

Member Avatar for IcantC
0
10K
Member Avatar for bmichelle510

How does your code change the value of the counter? Add some printlns to show the value of the counter every time it is changed and to show it when it is being tested.

Member Avatar for bmichelle510
0
233
Member Avatar for enrichedd

[QUOTE]Need some help fixing the errors in my code,[/QUOTE] Please post the full text of the error messages if you need help with them.

Member Avatar for hfx642
0
173
Member Avatar for Lemony Lime

[QUOTE]I need to be able to read lines of code from a .txt file, and then execute them in Java. [/QUOTE] Yes, you could use classes that implement the JavaCompiler interface to compile a java program within your running java program and have the class files created available for using …

Member Avatar for NormR1
0
3K
Member Avatar for Ambitious girl

I suggest you read the API doc for the String class. It will answer many of your quesions. Go to this site and Find String in the lower left, click on the link and the API doc will be in the main window. [url]http://download.oracle.com/docs/cd/E17409_01/javase/6/docs/api/[/url]

Member Avatar for NormR1
0
105
Member Avatar for sk8ergirl

Have you an algorithm for outputing the numbers in the order that you want them to be printed? Is there one algorithm for all the output or is there a different one for each pair of outputs you have posted? You have posted a lot of samples of program output …

Member Avatar for NormR1
0
506
Member Avatar for sk8ergirl

Is this thread the same topic as [url]http://www.daniweb.com/software-development/java/threads/399522[/url]

Member Avatar for NormR1
0
707
Member Avatar for ahmedshayan
Member Avatar for JaffaApophis

[QUOTE]what I have to put in the main class for them tu run?[/QUOTE] Both those methods need to be called with an ActionEvent object for parameter. You can get that parameter by adding an action listener to a component like a button. When that listener's actionPerformed method is called it …

Member Avatar for JamesCherrill
0
452
Member Avatar for chriswinter

[QUOTE]encrypt by making letter a letter z and b, y [/QUOTE] Perhaps if you printed out all the values of the variables as the program executed you would see what the program is doing. Do you test with short simple Strings like "abc" and see what happens to those 3 …

Member Avatar for NormR1
0
298
Member Avatar for Eragah

[QUOTE]How do i transfer the input from the main method to the getBoard constructor method.[/QUOTE] Confusing terminology. Is getBoard a class with a constructor or a method in a class? Either way, you pass data from one method to another as arguments to that method. A very standard thing. Can …

Member Avatar for NormR1
0
267
Member Avatar for glenak

Do you have to continually check the database for the date? Or does it stay the same once you have read it? If the date that is read is unchanged after you read it, you could use a Timer to call a listener after waiting the time from now to …

Member Avatar for NormR1
0
104
Member Avatar for loserspearl

[QUOTE]clear button isnt working.[/QUOTE] Add some debugging printlns to your code to show the values of the variables as they are set and changed.

Member Avatar for NormR1
0
160
Member Avatar for BleepyE

[QUOTE] it doesnt work[/QUOTE] Please explain what the code does. It doesn't work covers lots of cases. Show the console from when you execute the code and add comments to explain what is not working. To copy the contents of the command prompt window: Click on Icon in upper left …

Member Avatar for BleepyE
0
117
Member Avatar for Jedilance
Member Avatar for alorand

If the data always comes in groups of three lines, read the three lines, process the data for the three lines and then read the next group of three lines.

Member Avatar for NormR1
0
250
Member Avatar for Joey_Brown

What code causes the NullPointerException at line 84? You should include all you image files in the jar file so you don't need to worry about reading them from the disk.

Member Avatar for NormR1
0
174
Member Avatar for ali11

What code is in the Main class? Will the Main class be an inner class? Or is the Main class the class with a main() method that will create instances of the Rational class and call its methods. There is no need to create a separate class just to hold …

Member Avatar for jwenting
0
199
Member Avatar for ibthevivin

[QUOTE] deriving the values for q,d,n, and p[/QUOTE] Single letter variable names are a poor technique. Use full words for variable names. Put it all where you want it: [CODE] (ten$ + " ten dollar bill" + ((ten$ > 1) ? "s":""))); [/CODE]

Member Avatar for JamesCherrill
0
142
Member Avatar for javabeg123

[QUOTE]if ( gender = male ) [/QUOTE] This is an assignment statement (=) not an equality test (==). [QUOTE] i don't know what to do next.[/QUOTE] What have you written code for and what do you need next?

Member Avatar for IcantC
0
182

The End.